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

Checking when a player's walkspeed changes?

Asked by
trecept 367 Moderation Voter
6 years ago
Edited 6 years ago
humanoid.WalkSpeed.Changed:connect(function()
    if humanoid.WalkSpeed ~= 16 then
        player:Kick()
    end
end)

I'm trying to make an anti-speed exploit script so when the exploiter changes their walkspeed to something other than 16 it kicks them. The only thing I'm having problems with is how to detect when the walkspeed is changed. Whenever I use .changed for the walkspeed it gives me this error: attempt to index field 'WalkSpeed' (a number value) How can I detect when walkspeed is changed?

1 answer

Log in to vote
1
Answered by
cabbler 1942 Moderation Voter
6 years ago

Changed is a specific event for each instance. WalkSpeed is not an instance. Alternative:

humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
    if humanoid.WalkSpeed ~= 16 then
        player:Kick()
    end
end)
0
couldn't have said it better Kulh 125 — 6y
Ad

Answer this question