Scripting Helpers is winding down operations and is now read-only. More info→
Ad
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 3 years ago
Edited 3 years 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 1336 Moderation Voter
3 years 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 11 — 3y
0
no worries! :) TGazza 1336 — 3y
0
why are you checking that on the client CaioAlpaca 342 — 3y
Ad

Answer this question