GetTime: Difference between revisions
From Onset Developer Wiki
No edit summary |
mNo edit summary |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | <syntaxhighlight lang="Lua> | ||
function OnPlayerSpawn() | |||
AddPlayerChat("You loaded into the server in "..GetTime().." seconds.") | |||
end | |||
AddEvent("OnPlayerSpawn", OnPlayerSpawn) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[SetTime]] | * [[SetTime]] |
Latest revision as of 01:33, 25 January 2020
Description
Get the client game time.
Syntax
GetTime()
Parameters
- This function has no parameters.
Return Value
- Returns the current game time as a floating point number.
Example
function OnPlayerSpawn()
AddPlayerChat("You loaded into the server in "..GetTime().." seconds.")
end
AddEvent("OnPlayerSpawn", OnPlayerSpawn)