Line 21: | Line 21: | ||
=Public Attributes= | =Public Attributes= | ||
− | {{ScriptFunction|string|ScriptID|{ get; }|Returns a unique identifier of this script runtime.|5=<pre></pre>|6=<pre></pre>}} | + | {{ScriptFunction|string|ScriptID|{ get; }|Returns a unique identifier of this script runtime.|5=<pre>scriptID = Space.ScriptID</pre>|6=<pre></pre>}} |
{{ScriptFunction|int|InstanceID|{ get; }|Returns a unique identifier for the instance of the region. Useful in the case of multiple shards/instances being used. InstanceID does not necessarily equal to the RegionID, even if there's only one instance running. |5=<pre>instance = Space.InstanceID</pre>|6=<pre></pre>}} | {{ScriptFunction|int|InstanceID|{ get; }|Returns a unique identifier for the instance of the region. Useful in the case of multiple shards/instances being used. InstanceID does not necessarily equal to the RegionID, even if there's only one instance running. |5=<pre>instance = Space.InstanceID</pre>|6=<pre></pre>}} |
Log a message to console. (only works on preview grid)
Space.Log("Log")
Subscribe to network messages on "key".
Space.SubscribeToNetwork("thekey")
Unsubscribe from network messages on "key".
Space.UnsubscribeFromNetwork("thekey")
Sends a network message to all client scripts.
Space.SendMessageToAllClientScripts("thekey",{"themessage"})
Sends a network message to a client script belonging to a specific player
Space.SendMessageToAllClientScripts(APlayerID,"thekey",{"themessage"})
Runs the given function as a coroutine. A parameter is optional.
Space.StartCoroutine("AFunctionName")
Returns a unique identifier of this script runtime.
scriptID = Space.ScriptID
Returns a unique identifier for the instance of the region. Useful in the case of multiple shards/instances being used. InstanceID does not necessarily equal to the RegionID, even if there's only one instance running.
instance = Space.InstanceID
Returns a unique identifier for the region. (Same ID seen in curator)
region = Space.RegionID
Access to the SScene class methods and properties.
Space.Scene
Access to the SDatabase class methods and properties.
Space.Database
Access to the SMath class methods and properties.
Space.Math
Access to the SShared class methods and properties.
Space.Shared
Access to the SWebservice class methods and properties.
Space.WebServices
Returns "Server" if this script is a Server script
type = Space.RuntimeType
Returns true if in Editor. (this will return false on server scripts)
IsInEditor = Space.InEditor
Time, in seconds, since this script runtime has been awake.
SecondsAwake = Space.TimeSinceAwake
Returns a string of the current Date/Time in UTC
DateAndTime = Space.DateTimeUTC
Returns the current Unix time (in seconds) (same as ServerTimeUnix)
unixtime = Space.LocalTimeUnix
Returns the current Unix time (in seconds) (same as LocalTimeUnix)
unixtime = Space.ServerTimeUnix
Server script events are "Magic methods" which, unlike client scripts, you don't have to bind or subscribe to. They will be called as long as you have their methods implemented in your server script.
An event function which will be called whenever an Avatar joins and will also contain the Avatar's ID as a parameter.
function OnAvatarJoin(playerID) player = playerID end
An event function which will be called whenever an Avatar leaves and will also contain the Avatar's ID as a parameter.
function OnAvatarLeave(playerID) player = playerID end
An event function which will be called whenever the server script receives a Network Message, and will contain the network message key String and message Table as a parameter.
function OnScriptServerMessage(key, table) theKeyString = key theSNetworkMessageTable = table end
|