How would I make a brick have a tool spawn and then make the tool disappear from the brick after being picked up?package aaa { function hammerItem::onPickup(%this,%obj,%player,%amt) { Parent::onPickup(%this,%obj,%player,%amt); if(isObject(%obj.spawnBrick)) { %obj.spawnbrick.setItem(0); } } };
And how would I prevent a player from swapping tools from said tool after picking it up?I need the arguments for the functions listed in the first reply.
And I need to know how to get the tool in a certain slot on a player. Or rather, what is the variable for tool slots? I'm stupid, I was using it to find it out. %client.player.tool[slot]
I know it's in capture the flag, but I can't seem to find it.