Liberty Unleashed
Scripting => Script Help => Topic started by: gamelaster on January 02, 2012, 02:15:38 pm
-
Hello, this is code:
function onPlayerCommand( pPlayer, szCmd, szParams )
{
if( szCmd = "kill" )
{
pPlayer.RemoveLimb( BODYPART_HEAD );
MessagePlayer( "Zabil si sa", pPlayer );
}
}
What Is bad???
If im type /kill, not send message and dont remove head
-
You're mixing client scripts with server scripts.
Add this to your client script:
pPlayer <- FindLocalPlayer();
function onClientCommand( szCmd, szParams )
{
if( szCmd == "kill" )
{
pPlayer.RemoveLimb( BODYPART_HEAD );
Message( "Zabil si sa" );
}
}
-
Use thijn's code and make it szCmd == "kill", with two equal signs.
-
Use thijn's code and make it szCmd == "kill", with two equal signs.
ah right, fixed.