Squirrel/Server/Functions/Objects/CreateObject
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|CreateObject}} == Syntax == <code>CreateObject( ModelID, Vector )</code> __NOTOC__ == Arguments == * ''' ModelID ''' - The Model of the pickup to be created.…') |
Revision as of 11:21, 12 October 2010
Syntax
CreateObject( ModelID, Vector )
Arguments
- ModelID - The Model of the pickup to be created.
- x y z - The Vector where you want the pickup to be created.
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.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.