Squirrel/Server/Functions/Objects/CreateObject

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (Fixed typo in Vector argument)
 
Line 7: Line 7:
  
 
* ''' ModelID ''' - The Model of the pickup to be created.
 
* ''' ModelID ''' - The Model of the pickup to be created.
* ''' [[Squirrel/Script_Types/Vector|Vector]] ''' - The Vector where you want the pickup to be created.
+
* ''' [[Squirrel/Script_Types/Vector|Vector]] ''' - The Vector where you want the object to be created.
  
 
== Example ==
 
== Example ==

Latest revision as of 20:54, 8 December 2017

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

[edit] Syntax

  1. object = CreateObject( ModelID, Vector )

[edit] Arguments

  • ModelID - The Model of the pickup to be created.
  • Vector - The Vector where you want the object to be created.

[edit] Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "ramp" )
  5. {
  6. local pos = player.Pos;
  7. CreateObject( 1378, Vector( pos.x, pos.y, pos.z ) );
  8. }
  9. }
  10.  

This command will create a ramp at the player's location.

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox