Player.Skin

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This member variable returns or sets the skin of the player.

Syntax

  1. int Player.Skin
  1. Player.Skin = int skin

Arguments

  • skin - This is the new skin ID for the player

Example 1. Returning

This command gives player the ID of the skin they are using when they type '/skin'.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "skin" )
  5. {
  6. MessagePlayer( "Your current skin is: " + player.Skin, player );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Example 2. Setting

This command changes the skin of the player when they type '/setskin <skin id>'.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setskin" )
  5. {
  6. local skin = text ? text.tointeger() : 0;
  7. MessagePlayer( "Setting your skin to " + skin, player );
  8. player.Skin = skin;
  9. }
  10. return 1;
  11. }
  12.  

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox