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

AntiExploit not kicking??? (extra text cuz site says it doesnt look like a question)

so ive tested my game with executors like skisploit simple none paid ones and when i set any value over the limit that i set in game it is supposed to kick the player but it doesnt

game.Players.PlayerAdded:Connect(function(plr)
local moral = plr.Nut.Moral.Value
local coins = plr.Nut.Coins.Value
wait(2)
if moral >= 1001 then
	plr.Nut.Moral.Value = 1000
	if coins >= 10000001 then
		plr.Nut.Coins.Value = 10000000
	end
	if plr.Experience.Will.Value >= 1000001 then
		plr.Experience.Will.Value = 1000000
	end
	if plr.Experience.Skill.Value >= 1000001 then
		plr.Experience.Skill.Value = 1000000
	end
	if plr.Experience.Strength.Value >= 1000001 then
		plr.Experience.Strength.Value = 1000000
	end
	if plr.Character.Humanoid.WalkSpeed >= 201 then
		plr.Character.Humanoid.WalkSpeed = 16
		plr:Kick("Unexpected Humanoid Change")
	end
	if plr.Character.Humanoid.JumpPower >= 51 then
		plr.Character.Humanoid.JumpPower = 50
		plr:Kick("Unexpected Humanoid Change")
	end
	if plr.Character.Humanoid.MaxHealth >= 801 then
		plr.Character.Humanoid.MaxHealth = 800
		plr:Kick("Unexpected Humanoid Change")
	end
	if plr.Character.Humanoid.HipHeight >= 1.36 then
		plr.Character.Humanoid.HipHeight = 1.35
		plr:Kick("Unexpected Humanoid Change")
	end
	if plr.Character.Humanoid.MaxSlopeAngle >= 90 then
		plr.Character.Humanoid.MaxSlopeAngle = 89
		plr:Kick("Unexpected Humanoid Change")
	end
	
	
end
end)

i tried a while true do loop but that just made it where the player couldnt spawn in

1 comment

0

Did my answer work?

2 answers

✓ Accepted answer

its because the script only runs once when the PlayerAdded event fires, so the if statments will run once, so if you changed a value after the PlayerAdded event fires, it wont do anything since its not running. if you want to fix this, i suggest using Changed events, as it fires if one of the objects properties changes such as your values.

2 comments

0

While correct, this missed the scope entirely.

0

alright thank you

I would be trying this,

This will be a server sided script.

game.Players.PlayerAdded:Connect(function(plr)
local moral = plr.Nut.Moral
local coins = plr.Nut.Coins
wait(2)
moral.Changed:Connect(function()
if plr.Nut.Moral.Value > 1000 then
    plr.Nut.Moral.Value = 1000
end
end)
    coins.Changed:Connect(function() 
if coins.Value > 10000000 then
        plr.Nut.Coins.Value = 10000000
end
    end)
--  6 zeros, skillz , strength , xp
     plr.Experience.Will.Changed:Connect(function() 
if plr.Experience.Will.Value > 10000000 then
        plr.Experience.Will.Value = 10000000
end
    end)
       plr.Experience.Skill.Changed:Connect(function() 
if plr.Experience.Skill.Value > 1000000 then
        plr.Experience.Skill.Value = 1000000
    end
    end)
    plr.Experience.Strength.Changed:Connect(function()
if plr.Experience.Strength.Value > 1000000 then
        plr.Experience.Strength.Value = 1000000
    end
end)
function hum()
   plr.Character.Humanoid.Changed:Connect(function()
if plr.Character.Humanoid.WalkSpeed>= 201 then
        plr.Character.Humanoid.WalkSpeed = 16
        plr:Kick("Unexpected Humanoid Change")
    end
end)
plr.Character.Humanoid.Changed:Connect(function()
    if plr.Character.Humanoid.JumpPower >= 51 then
        plr.Character.Humanoid.JumpPower = 50
        plr:Kick("Unexpected Humanoid Change")
    end
    if plr.Character.Humanoid.MaxHealth >= 801 then
        plr.Character.Humanoid.MaxHealth = 800
        plr:Kick("Unexpected Humanoid Change")
    end
    if plr.Character.Humanoid.HipHeight >= 1.36 then
        plr.Character.Humanoid.HipHeight = 1.35
        plr:Kick("Unexpected Humanoid Change")
    end
    if plr.Character.Humanoid.MaxSlopeAngle >= 90 then
        plr.Character.Humanoid.MaxSlopeAngle = 89
        plr:Kick("Unexpected Humanoid Change")
    end
end)
end
hum()
plr.CharacterAdded:Connect(hum)
end)

Put a local script in the StarterGui and put this code

plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local moral = plr.Nut.Moral
local coins = plr.Nut.Coins
wait(2)
moral.Changed:Connect(function()
if plr.Nut.Moral.Value > 1000 then
    plr.Nut.Moral.Value = 1000
end
end)
    coins.Changed:Connect(function() 
if coins.Value > 10000000 then
        plr.Nut.Coins.Value = 10000000
end
    end)
--  6 zeros, skillz , strength , xp
     plr.Experience.Will.Changed:Connect(function() 
if plr.Experience.Will.Value > 10000000 then
        plr.Experience.Will.Value = 10000000
end
    end)
       plr.Experience.Skill.Changed:Connect(function() 
if plr.Experience.Skill.Value > 1000000 then
        plr.Experience.Skill.Value = 1000000
    end
    end)
    plr.Experience.Strength.Changed:Connect(function()
if plr.Experience.Strength.Value > 1000000 then
        plr.Experience.Strength.Value = 1000000
    end
end)
function hum()
   plr.Character.Humanoid.Changed:Connect(function()
if plr.Character.Humanoid.WalkSpeed>= 201 then
        plr.Character.Humanoid.WalkSpeed = 16
        plr:Kick("Unexpected Humanoid Change")
    end
end)
plr.Character.Humanoid.Changed:Connect(function()
    if plr.Character.Humanoid.JumpPower >= 51 then
        plr.Character.Humanoid.JumpPower = 50
        plr:Kick("Unexpected Humanoid Change")
    end
    if plr.Character.Humanoid.MaxHealth >= 801 then
        plr.Character.Humanoid.MaxHealth = 800
        plr:Kick("Unexpected Humanoid Change")
    end
    if plr.Character.Humanoid.HipHeight >= 1.36 then
        plr.Character.Humanoid.HipHeight = 1.35
        plr:Kick("Unexpected Humanoid Change")
    end
    if plr.Character.Humanoid.MaxSlopeAngle >= 90 then
        plr.Character.Humanoid.MaxSlopeAngle = 89
        plr:Kick("Unexpected Humanoid Change")
    end
end)
end
plr.CharacterAdded:Connect(hum)
hum()

hope this helps

6 comments

0

why would you need to put the exact same thing in different types of scripts?

0

because they can use a local script instead of server sided script

0

And Humanoid.WalkSpeed is replicated

0

The client should never take part in anti-exploit scripts. The script is also extremely messy and poorly planned out.

0

You wouldn't rely on a single heuristic, but multiple. And not all speed exploits change the WalkSpeed, some change the frames per second and they seem faster.

0

i did have this localscripted before but it didnt work at all and an exploiter could just delete it and the server wouldnt even notice

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