Blockland Forums > Modification Help
Spawning a fake dropped item
(1/2) > >>
Wheatley:
Is there a way to have a player "drop" an item without actually dropping it?
In other words, throwing an item, but the item remains in the player's inventory.
Also, the fake dropped item can be picked up by other players.

It would also be nice if I could control how long the dropped item remains before it fades out.
Gadgethm:
I think the global variable for fade time is either $Pref::Item::Poptime or maybe $Item::Poptime.  I'd have to look it up, it's been a while.
It's $Game::Item::PopTime, I just looked it up.  Remember it's in milliseconds, so 1000 = 1 second
Ash:
My guess is that the commands to remove a tool from the inventory and toss and item from the player are separate. You could probably just use the toss command.

I would look into the grenade scripts, and see if there's a separate command for removing the item. If so, just delete it.
Chrono:
The simplest way to do it would be to package the throw command, check (and store into a variable) what item the player is throwing before calling parent, then call parent, and if that variable exists, add the item back into the inventory after the parent is called.
Greek2me:
You can spawn an item like so:

--- Code: (A project of mine) --- %item = new Item()
{
dataBlock = "slyrCTF_Flag" @ %image.colorID @ "Item";

position = %this.getEyeTransform();

spawnBrick = %brick;
canPickup = 1;
};
missionCleanup.add(%item);
--- End code ---
Navigation
Message Index
Next page

Go to full version