Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

I'm trying to make an anti-speed exploit script but it's not working with this script?

Asked by 1 month ago
Edited 1 month ago

I am trying to make my game kick any players that speed hack. If you're wondering what the number 44 is for, it's because I've already added a shift to sprint system to the game and that's the sprinting speed. But the problem with the script below is that whenever I enter the game, it kicks me the second I enter.

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
repeat wait() until LocalPlayer.Character

while true do
    wait()
    if LocalPlayer.Character.Humanoid.WalkSpeed ~= 0 or 16 or 44 then
        LocalPlayer:Kick("Exploiting")
        wait(10)
    end
end

1 answer

Log in to vote
0
Answered by
TGazza 360 Moderation Voter
1 month ago

I assume you want the player(s) to move at those speeds? If so try this:

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
repeat wait() until LocalPlayer.Character

while true do
    wait()
    local WS = LocalPlayer.Character.Humanoid.WalkSpeed
    --if LocalPlayer.Character.Humanoid.WalkSpeed ~= 0 or 16 or 44 then <<-- this won't work and will allways return true due to 16 and 44 are non null numbers!
    if WS~= 0 and WS ~= 16 and WS ~= 44 then
        LocalPlayer:Kick("Exploiting [Walkspeed!]")
        wait(10)
    end
end
0
I see the problem thank you! osamayousef123 14 — 1mo
0
no worries! :) TGazza 360 — 1mo
0
why are you checking that on the client CaioAlpaca 342 — 1mo
Ad

Answer this question