Hello! I’m trying to make a anti-cheat, but I’m not sure why this isn’t working. Help? (Code below.) I’m not sure what to change.
Code:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Wait()
player.Character:WaitForChild("Humanoid")
player.Character.Humanoid.WalkSpeed.Changed:Connect(function(player)
if player.Character.Humanoid.WalkSpeed >= 33 then
player:Kick("Kicked \nYour account has been kicked from this experience for cheats, exploits, or other reasons. \n \nWas this a mistake? Don't worry, it's just a kick. We will look into this later and determine if you were hacking. \n \nThis kick was given by the anti-cheat of this experience. Roblox, or Roblox Support cannot do anything in this circumstance.")
end
end)
end)
Error:
ServerScriptService.Main.Anti-Cheat:4: attempt to index number with 'Changed'