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

Checking when a player's walkspeed changes?

Asked by
trecept 367 Moderation Voter
2 years ago
Edited 2 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 1927 Moderation Voter
2 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 — 2y
Ad

Answer this question