IsServer: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Client & Server|1.4.0}} {{FuncDescription|Used to check if a script currently runs on the server.}} {{FuncSyntax|IsServer()}} {{FuncParameters}} {{FuncNoPar...")
 
(No difference)

Latest revision as of 19:38, 14 December 2020

IsServer

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

Description

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

Syntax

IsServer()

Parameters

  • This function has no parameters.

Return Value

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

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