Squirrel/Server/Functions/Spheres/Colour

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(i)
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Sphere.Colour}}
 
This ''Sphere'' class member returns or sets the colour ID of the sphere.
 
This ''Sphere'' class member returns or sets the colour ID of the sphere.
  

Revision as of 10:35, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Sphere class member returns or sets the colour ID of the sphere.

Syntax

You can either return or set a new value using this member:

  1. int Sphere.Colour
  1. Sphere.Colour = int newcol

Arguments

  • newcol - This is the new colour for the sphere as an integer

Example 1. Returning

  1.  
  2. function onPlayerFootSphereHit( player, sphere )
  3. {
  4. MessagePlayer( "This sphere currently has the colour: " + sphere.Colour, player );
  5. }
  6.  

This will message the player with the spheres colour when they hit it.

Notes

The call onPlayerFootSphereHit was used in in this example. More info about this in the corresponding page.

Example 2. Setting

  1.  
  2. function onPlayerFootSphereHit( player, sphere )
  3. {
  4. sphere.Colour = 1;
  5. }
  6.  

This will set the sphere to colour 1 when it is hit.

Notes

The call onPlayerFootSphereHit was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox