Squirrel/Client/Events/Sphere/onClientEnterSphere

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
(Example)
 
Line 15: Line 15:
  
  
Example 1: Spawn a sentinel near the sphere when entered
+
Example 1: Say "hello world" when somebody enters the sphere
 
<code lang="squirrel">
 
<code lang="squirrel">
 
  function onClientEnterSphere(sphere)
 
  function onClientEnterSphere(sphere)
 
  {
 
  {
   CreateVehicle( 95, Vector( sphere.Pos.x - 3, sphere.Pos.y, sphere.Pos.z + 0.5 ), 90 );
+
   Message("hello world");
 
  }
 
  }
 
</code>
 
</code>
Line 27: Line 27:
 
-- List of used functions and other notes here.
 
-- List of used functions and other notes here.
  
CreateVehicle
+
Message
  
sphere.Pos      
+
sphere.Pos
                                                 
+
Also note that this may spawn the car out of bounds, depending where you placed the sphere. You must have free space -3 x from the sphere so your vehicle won't get stuck!
+
  
 
== Related Events ==
 
== Related Events ==

Latest revision as of 18:34, 2 July 2015

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

This event is called when the local player enters a sphere

[edit] Syntax

  1. function onClientEnterSphere( sphere )

[edit] Arguments

  • sphere - The pointer of the sphere entered

[edit] Example

Some explanation here


Example 1: Say "hello world" when somebody enters the sphere

  1.  
  2. function onClientEnterSphere(sphere)
  3. {
  4. Message("hello world");
  5. }
  6.  

[edit] Notes

-- List of used functions and other notes here.

Message

sphere.Pos

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox