I am making a script that kicks people when there walkspeed exceeds a certain limit. Why isn't this working? The script is under StarterCharactarScripts in StarterPlayer
plr = script.Parent.Name
if script.Parent.Humanoid.Changed:connect()then
if script.Parent.Humanoid.WalkSpeed > 22 then
game.Players.plr:Destroy()
end
end

6 comments
https://devforum.roblox.com/t/ways-to-patch-common-exploits/98961/35
Try game.Players:FindFirstChild(plr):Destroy()
you mean :Kick() not :Destroy()
True. :Kick() Is better and allows you to leave a message.
kick() remove() disconnect()
I don't recommend this but, use Remote Events and access a script in the replicated storage. Or simply use a Local Script... Probably your error.