Delay: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|Delay}}
{{FuncDescription|Create a delayed function just like a timer but with once ([[DelayFor]])}}


{{FuncSyntax|Delay(Milliseconds, LuaFunction [, UserArgs])}}
{{FuncSyntax|Delay(Milliseconds, LuaFunction [, UserArgs])}}
Line 23: Line 23:


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
*[[GetTimerCount]]
*[[GetAllTimers]]
*[[IsValidTimer]]
*[[CreateTimer]]
*[[CreateCountTimer]]
*[[DestroyTimer]]
*[[PauseTimer]]
*[[UnpauseTimer]]
*[[GetTimerRemainingTime]]

Revision as of 16:14, 17 November 2019

Delay

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Create a delayed function just like a timer but with once (DelayFor)

Syntax

Delay(Milliseconds, LuaFunction [, UserArgs])

Parameters

  • Milliseconds
    The interval in milliseconds.
  • LuaFunction
    The lua function name
  • UserArgs (optional) (optional)
    The user arguments

Return Value

  • __EDIT_ME__

Example

AddEvent("OnPlayerSpawn", function(player)
	SetPlayerOutline(player, true)
	Delay(10000, function(player)
		SetPlayerOutline(player, false)
	end)
end)

See also