Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you check that a ModuleScript is being called locally or serverside?

I am doing this for security reasons with my module I'm making.

1 answer


RunService


You can do this by using the IsClient and IsServer functions of the RunService, for example:

local rs = game:GetService("RunService")

if rs:IsServer() then
	print("server")
else
	print("client")
end

Hopefully this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.