Author Topic: Need some info.  (Read 863 times)

I need to know how to make you lose an item once you throw it.
I also need to know how to make it, that if you touch the projectile of the thrown item, then you pick it up, and it will disappear.

Ahh a baseball/sport game of some sought I presume?
1. Geeks grenade - Although he's most likely annoyed at the amount of people using it.
2. I tryed this ages ago,
But I'll just chuck some guesses:
Maybe on armor collision with the object add tool to the inventory then hide the shape from the game. (I think that might make a clutter of useless hidden shapes though) or maybe just delete the collision, I'm not sure.
« Last Edit: April 04, 2008, 08:52:55 AM by Destiny/Zack0Wack0 »

Football actually. And yes, I have looked at the HE-Grenade. Couldn't find anything... :/

Change the projectile::onCollision to make them pick up that item.

Also, the script in the grenade is the best way to do it.

Code: [Select]
function footballImage::onMount(%this, %obj, %slot)
{
%obj.footballslot = %obj.currTool;
}

function footballImage::onFire(%this, %obj, %slot)
{
%obj.playthread(2, spearThrow);
Parent::OnFire(%this, %obj, %slot);

for(%i=0;%i<5;%i++)
{
%toolDB = %obj.tool[%i];
if(%toolDB $= %this.item.getID() && %i == %obj.footballslot)
{
%obj.tool[%i] = 0;
%obj.weaponCount--;
messageClient(%obj.client,'MsgItemPickup','',%i,0);
serverCmdUnUseTool(%obj.client);
break;
}
}
}