Author Topic: Mounting Weapon on Player Type  (Read 625 times)

This is for the army men mod, what I wanted is to have a primary and secondary weapon for each player type, and have the person key bind them. Then when they press it in game they take it out.
I'm doing this because I don't want to release lots of weapons separately that do the same thing as the blockland weapons. Like this they'll just come with the player type, and won't spam up the item list.

Here's the code I put in at the end of the army man soldier player type. (the datablock is just soldier for now, and the command gun will be changed to "primary")

Code: [Select]
function servercmdgun(%client)
{
if(%client.player.dataBlock $= "soldierArmor")
{
%client.player.mountImage(ArmyManMP40Image,$RightHandSlot);
        %client.player.playThread(0,armreadyright);
}
else
{

}
};

And it obviously doesn't work because the player type won't show up in the menu. Any help?

Also, is it possible to do a colorshift for the weapon so that it changes to whatever color your body color is?

What's with the else part? It has nothing in it. And wouldn't the problem with the playertype not showing up in the menu be because of the player type? For mounting an image on a player, look at a script like the duplicator script where you type /duplicator or the fill can script where you type /fillcan or my script where you type /wrench to get a wrench. Oh and the .datablock thing I think isn't a valid check. You might need to do something like %client.player.getDatablock().getName() $= "SoldierArmor"
« Last Edit: May 10, 2009, 04:24:13 PM by AGlass0fMilk »

i'm an idiot, i totally forgot about those scripts.

Just copied and pasted what was in those, and it was the code i insterted because it worked without it.

Locking.