Scripting/Squirrel/Functions/FindObject
This wiki is using an old backup from 2020
Some information may be old/missing
Syntax
FindObject(ID)
Arguments
- int ID - The ID of the object to find
Example
function onPlayerCommand( player, cmd, text )
{
if(cmd == "findobject")
{
local obj = FindObject(text.tointeger());
if (obj)
{
obj.Pos = player.Pos;
MessagePlayer("[#00FF00]Object has been found and has been teleported to you!", player);
} else {
MessagePlayer("[#FF0000]Object has not been found :(", player);
}
}
}
Notes
Call onPlayerCommand was used in this example. More info about it in the page.