GetTime: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetTime()}} {{FuncParameters}} {{FuncNoParam}} {{FuncReturnValue|Returns the current game time as..."
 
REDRUM (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Get the client game time.}}


{{FuncSyntax|GetTime()}}
{{FuncSyntax|GetTime()}}
Line 11: Line 11:


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua>
function OnPlayerSpawn()
AddPlayerChat("You loaded into the server in "..GetTime().." seconds.")
end
AddEvent("OnPlayerSpawn", OnPlayerSpawn)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[SetTime]]

Latest revision as of 01:33, 25 January 2020

GetTime

Type: Function
Context: Client
Introduced: v1.0

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)

See also