I'm trying to make an anti exploit in server script service, because if I did it in a local script, the player could access it, and find a way to avoid detection. But I cannot figure out a way to access him in ServerScriptService.
main = require(script.Parent.Executions.Source) -- A module script
wait(1)
local name = ?? -- I cannot figure this out!
local plr = game.Players:WaitForChild(name)
while wait(5) do
if game.Workspace:WaitForChild(name).Humanoid.WalkSpeed > 16 then
if not game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 5473029) -- if he does not have the gamepass then
if game.Workspace:WaitForChild(name):FindFirstChild("Acceleration Coil") == nil then -- if he does not have a speed coil
main.kick_Exploiter(name) -- calls the module script to kick player
end
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 5473029) then -- if the player does have the gamepass, but is still exploiting
if game.Workspace:FindFirstChild(name).Humanoid.WalkSpeed > 25 then
main.kick_Exploiter(name) -- calls the module script to kick player
end
end
end
if game.Workspace:WaitForChild(name).Humanoid.JumpPower > 50 then -- checks the jump power
if game.Workspace:WaitForChild(name):FindFirstChild("Gravity Coil") == nil then -- if the player does not have a gravity coil
main.kick_Exploiter(name) -- calls the module script to kick player
end
end
end
Module script:
module = {}
function module.kick_Exploiter(name)
local plr = game.Players:WaitForChild(name)
plr:Kick("You have been kicked for exploiting, please let this game be fun for other players!")
end
return module

1 comment
You can always loop through the children of the Players service.