Scripting/Squirrel/Functions/Object.World: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "== Syntax == <pre>Object.World = world;</pre> == Arguments == '''> Object''' - The object instance. * ''integer'' '''world''' - The world you want to set on object == Ex...") |
No edit summary |
||
| Line 49: | Line 49: | ||
} | } | ||
</pre> | </pre> | ||
== Related Functions == | |||
{{Scripting/Squirrel/Functions/Object_Functions}} | |||
[[Category:Scripting/Squirrel/Functions/Object_Functions]] | |||
Latest revision as of 18:33, 30 January 2017
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);
}
}