Is there an easy way to pick up a weapon or ammo with a keybind instead of on collision?
Currently, when walking over a weapon, it's added to inventory. Also, you can throw the weapon (alt + w) or ammo (alt + a).
Thanks the Cookbook script worked great.
Now I just need to figure out how to apply it to weapons and mounting the image in the characters hands.
Code: Select all
%player.setInventory(RocketLauncher, 1); %player.setInventory(RocketLauncherAmmo, %player.maxInventory(RocketLauncherAmmo)); %player.mountImage(RocketLauncherImage, 0);
It could be put almost anywhere. If you collided with the weapon you could throw the code in as a callback somehow or as a trigger or upon spawn. It all depends on your needs. The code example above is from an example where the code is executed during a spawn.Thanks. But I'm not sure where to put that code.
Should it be in the serverCmdPickupObject function somewhere?
(Trying to be able to pick up weapons with a keybind instead of collision)
Steve Acaster made some real good tutorials:I'll give it a shot. (Scripting newb here!)