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

My speed anticheat doesn't work, can somebody help?

Asked by 3 years ago

My anticheat is located in StarterGui

local tag = game.Players.LocalPlayer.Name
local char = game.Workspace:FindFirstChild(tag)
local player = game.Players.LocalPlayer

if char.Humanoid.WalkSpeed >= 16 then
    player:Kick("Haha no speed 4 u")
end

1 answer

Log in to vote
0
Answered by 3 years ago

the script was checking only once, and not constantly.

also >= means that if the walkspeed was EQUAL TO or MORE THAN 16, it would kick the player, which would mean that if a player was moving at 16 walkspeed they would be kicked immediately since it is the default walkspeed value, unless that is not the case in your game

local player = game.Players.LocalPlayer
local run = game:GetService("RunService")

run.RenderStepped:Connect(function() -- allows to check constantly
    local char = player.Character
    if char then
        local hum = char:FindFirstChildWhichIsA("Humanoid")
        if hum then
            if hum.WalkSpeed > 16 then
                player:Kick("Haha no speed 4 u") -- kill
            end
        end
    end
end)

script is supposed to be localscript.

i tested if the client could kick itself, and it worked, not sure if it will for you.

Ad

Answer this question