I'm making an Anti-Exploit, but I'm wondering is there anyway that this is possible
From Server:
M = require "ModuleScript" M.output("hi")
Console Output: hi
From Client
M = require "ModuleScript"' M.output("hi")
Console Output: XX:XX:XX.XXX script:2 ModuleScript can only be called in a Server side script
Anyone help?
SirTomHamishWatson; Team Neoprene Head Programmer
A simple way to do this would be to check if the LocalPlayer exists or not.
You can only access the LocalPlayer on the client
The module would look like this:
local module = {}; --Define module table module.output = function(blah) --Define a new 'print' function local p = game.Players.LocalPlayer; if p then --Check if LocalPlayer exists --If it does exist, the module was called on the client warn("ModuleScript can only be called in a Server side script"); else --If not, the module was called on the server print(blah); end end return module;
You could also do this by checking if ServerStorage exists, since it can only be accessed on the server..