Scripting/Squirrel/Functions/Object.World
This wiki is using an old backup from 2020
Some information may be old/missing
Syntax
Object.World = world;
Arguments
> Object - The object instance.
- integer world - The world you want to set on object
Example
This example will create a pickup on given location and prints its World on console
function onScriptLoad() { myObject <- CreateObject( 334, 1, Vector( -2261.12, 753.12, 211.123 ),255 ); print(myObject.World); }
Example 2
This example will create a pickup on given location and you can change the world via commands given below.
function onScriptLoad() { myObject <- CreateObject( 334, 1, Vector( -2261.12, 753.12, 211.123 ),255 ); } function onPlayerCommand(player, cmd, text) { if(cmd =="world1") { myObject.World = 1; MessagePlayer("The object has been sent to world 1",player); } else if(cmd =="world2") { myObject.World = 2; MessagePlayer("The object has been sent to world 2",player); } else if(cmd =="myworld") { myObject.World = player.World; MessagePlayer("The object has been sent to your world",player); } }