Scripting/Squirrel/Functions/Object.MoveTo: 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 "This function move an object to a specified local. == Syntax == <pre>object.MoveTo( Vector pos, int time );</pre> == Arguments == * ''Object'' '''object''' - A valid object...") |
No edit summary |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 10: | Line 10: | ||
== Example == | == Example == | ||
<pre> | <pre>function onScriptLoad() | ||
{ | |||
gate <- CreateObject( 3685, 1, 384.108, -505.87, 9.65089, 255 ); | |||
}</pre> | |||
<pre>function onPlayerCommand( player, cmd, text ) | |||
{ | |||
if(cmd == "test" ) | |||
{ | |||
MessagePlayer("Gate moved!", player ); | |||
gate.MoveTo( Vector(384.108, -805.87, 9.65089), 1000 ) | |||
} | |||
}</pre> | |||
== Related Functions == | |||
{{Scripting/Squirrel/Functions/Object_Functions}} | |||
[[Category:Scripting/Squirrel/Functions/Object_Functions]] | |||
Latest revision as of 18:33, 30 January 2017
This function move an object to a specified local.
Syntax
object.MoveTo( Vector pos, int time );
Arguments
- Object object - A valid object instance.
- VECTOR vector - Position where the object will be taken
- INT time - Time period within which the object has to move, in ms.
Example
function onScriptLoad()
{
gate <- CreateObject( 3685, 1, 384.108, -505.87, 9.65089, 255 );
}
function onPlayerCommand( player, cmd, text )
{
if(cmd == "test" )
{
MessagePlayer("Gate moved!", player );
gate.MoveTo( Vector(384.108, -805.87, 9.65089), 1000 )
}
}