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

Can`t read WalkSpeed / JumpPower?

Asked by 5 years ago
Edited 5 years ago

Helllo, i wrote this code for Anti-Hacking! if i change WalkSpeed / JumpPower it doesnt kick me?? can someone please help?! i can try to print the WalkSpeed / JumpPower but its always the same, even if i change it!? i have to change the walkspeed sometimes so i made a Changing BoolValue so i can set Changing to true then change the walkspeed in the script.Configuration then wait until walkspeed was changed in humanoid then set Changing to false

Put this code into StarterCharacterScripts:

-- Settings --
kickIfFellOut = true

kickFromWalkSpeed = true
maxWalkSpeed = 20

kickFromJumpPower = true
maxJumpPower = 50
--------------
local config = Instance.new("Configuration", script)
local changing = Instance.new("BoolValue", config)
changing.Name = "Changing"
local walkspeed = Instance.new("IntValue", config)
walkspeed.Name = "WalkSpeed"
walkspeed.Value = 16
local jumppower = Instance.new("IntValue", config)
jumppower.Name = "JumpPower"
jumppower.Value = 50

local fpdh = workspace.FallenPartsDestroyHeight
local plr = game.Players:FindFirstChild(script.Parent.Name)

while true do wait()
    local hum = script.Parent:FindFirstChild("Humanoid")
    if hum then
        if kickFromWalkSpeed then
            if config.WalkSpeed.Value > maxWalkSpeed then
                plr:Kick("WalkSpeed Cheat")
            end
        end
        if (not config.Changing.Value) and (not config.WalkSpeed.Value == hum.WalkSpeed) then
            plr:Kick("JumpPower Cheat")
        end
        if config.Changing.Value then
            hum.WalkSpeed = config.WalkSpeed.Value
            wait()
            if config.Changing.Value then
                wait()
            end
            if config.Changing.Value then
                plr:Kick("WalkSpeed Cheat")
            end
        end


        if kickFromJumpPower then
            if config.JumpPower.Value > maxJumpPower then
                plr:Kick("JumpPower Cheat")
            end
        end
        if (not config.Changing.Value) and (not config.JumpPower.Value == hum.JumpPower) then
            plr:Kick("JumpPower Cheat")
        end
        if config.Changing.Value then
            hum.JumpPower = config.JumpPower.Value
            wait()
            if config.Changing.Value then
                wait()
            end
            if config.Changing.Value then
                plr:Kick("JumpPower Cheat")
            end
        end
    end


    if kickIfFellOut then
        local hrp = plr.Character:FindFirstChild("HumanoidRootPart")
        if hrp then
            local pos = hrp.Position
            if pos.Y < fpdh+100 then
                plr:Kick("Fell out of world")
            end
        end
    end
end

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

I see you are comparing the values in config, but do you actually set them to reflect the walkspeed/jumppower of the humanoid? If not, they aren't going to just automatically change by themselves.

What you should do instead is check the properties of Humanoid on the Changed event

hum.Changed:Connect(function(prop)
    if prop == "WalkSpeed" or prop == "JumpPower" then
        --check
    en
end)

Btw, you should NEVER kick the player from a LocalScript. You should always do it from a server script, because if you do it locally, it can be bypassed by exploiters very very easily.

(And so they can override Humanoid.WalkSpeed or Humanoid.JumpPower to return fake values, therefor bypassing your anti cheat completly)

0
While I will agree some checks should be done server side; a check or two on the client (especially WalkSpeed and JumpPower) should be fine, it could stop skids, but for those of experienced exploiters who know how the scripts work it might be a problem. User#19524 175 — 5y
0
Even skids can bypass WalkSpeed and JumpPower checks. There are tons of scripts released on v3rmillion which do that Amiaa16 3227 — 5y
Ad

Answer this question