Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Checking when a player's walkspeed changes?

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

✓ Accepted answer

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)

1 comment

0

couldn't have said it better

This discussion is preserved as it was. New answers, comments, and votes are closed.