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

Is this Anti-SpeedHack safe from exploiters?

Asked by
Despayr 505 Moderation Voter
4 years ago

So I have placed a local script inside a screen gui with the field 'Reset on Spawn' set to false. The script gets the name of the Local Player, then sets its Parent to nil. It works fine, but what I want to know is:

Would hackers and exploiters still be able to delete a 'nil instance'? Is this a sure-fire way to prevent speed hackers?

local plr = game:GetService("Players").LocalPlayer

while true do
    wait()
    script.Parent = nil --Setting the parent to nil so hackers cannot delete it
    local character = plr.Character
    local human = character:FindFirstChildOfClass("Humanoid")
    if human then
        if human.WalkSpeed > 16 then
            plr:Kick()
        end
    end
end
0
DO NOT kick the player if they are caught, either reset their speed or respawn them. If the player is lagging then it's possible your script could trigger a false positive. MakeYourEscape 334 — 4y

2 answers

Log in to vote
1
Answered by
sheepposu 561 Moderation Voter
4 years ago

I think the safest way is to make a script in the ServerScriptService

game.Players.PlayerAdded:Connect(function(plr)
    repeat wait() until plr.Character
    while true do
        wait()
        if plr.Character.Humanoid.WalkSpeed > 16 then
            plr:Kick()
        end
    end
end)
0
If the player is an exploiter, the Server will not detect if his speed is changed. The best way in my opinion is to put that SpeedCheck in a LocalScript even if they can be deleted. JakyeRU 637 — 4y
0
how putting it in a local script better i, it can be deleted User#23252 26 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Putting the script in a localscript is not very safe.. because it could simply be deleted; so put this in a Server script, somewhere in ServerScriptService..

try to hook every statement with an event to reduce memory consumption, the bigger memory consumption, the laggy your game is..

local maxSpeed = 16 -- change to the absolutely max speed in game
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local humanoid = char:WaitForChild("Humanoid");

        if humanoid then
            humanoid.Changed:Connect(function()
                if humanoid.WalkSpeed > maxSpeed then
                    player:Kick("You just can't win  without cheating, can you? /:")
                end
            end)
        end

    end)
end)

Answer this question