Squirrel/Server/Functions/Objects/CreateObject
From Liberty Unleashed Wiki
(Difference between revisions)
Gamelaster (Talk | contribs) 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 | + | * ''' [[Squirrel/Script_Types/Vector|Vector]] ''' - The Vector where you want the object to be created. |
== Example == | == Example == |
Latest revision as of 21:54, 8 December 2017
[edit] Syntax
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
function onPlayerCommand( player, cmd, text ) { if ( cmd == "ramp" ) { local pos = player.Pos; CreateObject( 1378, Vector( pos.x, pos.y, pos.z ) ); } }
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.