Game Development Community

Get a weapon that a player is holding

by Will Pall · in Torque Game Engine · 07/07/2004 (5:53 pm) · 2 replies

I've just purchased the sdk and I'm totally new to all the functions and crap so, could someone tell me what variable/data holds the weapon that a player is holding? Is there a getWeapon() function?

What I'm wanting to do is cause the player/bot to throw the weapon they are holding on death (essentially drop it). I mean, you have to have some reward for killing that baddie. I just figured I'd ask all you experienced game makers before I continued on my search.

#1
07/07/2004 (6:05 pm)
I think this is what you're looking for:

function nameofyourfunction(%client)
{
%player = %client.player;
%weapon = %player.getMountedImage($WeaponSlot);
}

And then you just write something that makes it drop %weapon.
#2
07/07/2004 (6:18 pm)
Yeah, thats it. I think there's already a command for throwing a weapon, at least there's a command for onThrow() so surely there is an actual throw counterpart.