Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

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

Asked by
Donut792 216 Moderation Voter
6 years ago

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

0
Did my answer work? maumaumaumaumaumau 98 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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.

0
While correct, this missed the scope entirely. green271 635 — 6y
0
alright thank you Donut792 216 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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

0
why would you need to put the exact same thing in different types of scripts? User#23365 30 — 6y
0
because they can use a local script instead of server sided script maumaumaumaumaumau 98 — 6y
0
And Humanoid.WalkSpeed is replicated maumaumaumaumaumau 98 — 6y
0
The client should never take part in anti-exploit scripts. The script is also extremely messy and poorly planned out. User#19524 175 — 6y
View all comments (2 more)
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. User#19524 175 — 6y
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 Donut792 216 — 6y

Answer this question