IsClient

From Onset Developer Wiki
Revision as of 19:39, 14 December 2020 by BlueMountains (talk | contribs) (Created page with "{{Info|Function|Client & Server|1.4.0}} {{FuncDescription|Used to check if a script currently runs on the client.}} {{FuncSyntax|IsClient()}} {{FuncParameters}} {{FuncNoPar...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
IsClient

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

Description

Used to check if a script currently runs on the client.

Syntax

IsClient()

Parameters

  • This function has no parameters.

Return Value

  • Returns true on the client and false on the server.

Example

AddEvent("OnPackageStart", function()
	if IsServer() then
		print("This is printed to the server console.")
	end
	
	if IsClient() then
		print("This is printed to the game devlog.")
	end
end)

See also