So like I've done this script to remove cheaters from the game and I don't know what's wrong with it :(
01 | local Players = game:GetService( "Players" ) |
02 | local hackers = { |
03 |
04 | } |
05 |
06 | Players.PlayerAdded:Connect( function (plr) |
07 | plr.CharacterAdded:Connect( function (character) |
08 | local cheater = character:WaitForChild( "Humanoid" ) |
09 | if cheater.WalkSpeed > 16 or plr.Name = = hackers then |
10 | hackers = { plr.Name } |
11 | plr:Kick( "You have violated the walk speed limit." ) |
12 | end |
13 | end ) |
14 | end ) |
01 | game.Players.PlayerAdded:Connect( function (player) |
02 | player.CharacterAdded:Connect( function (character) |
03 | local humanoid 1 = character:WaitForChild( "Humanoid" ) |
04 | local humanoid = character:FindFirstChildOfClass( "Humanoid" ) -- so they cant rename humanoid |
05 | humanoid.Running:Connect( function (speed) |
06 | if speed > 17 then -- walkspeed kinda |
07 | player:Kick( 'speeding' ) |
08 | end |
09 | end ) |
10 | end ) |
11 | end ) |
pretty g00d
1 | hum = game.Players.LocalPlayer.Character:WaitForChild( "Humanoid" ) |
2 | plr = game.Players.LocalPlayer |
3 |
4 | if hum.WalkSpeed < 20 then |
5 | game.Player.Kick.(plr.Name):Kick( "Hacking" ) |
****So basically I put it in the comments but this will fix it I believe...
01 | local Players = game:GetService( "Players" ) |
02 | local hackers = { |
03 |
04 | } |
05 |
06 | Players.PlayerAdded:Connect( function (plr) |
07 | plr.CharacterAdded:Connect( function (character) |
08 | local cheater = character:WaitForChild( "Humanoid" ) |
09 | cheater.Changed:connect( function () |
10 | if cheater.WalkSpeed > 16 or plr.Name = = hackers then |
11 | hackers = { plr.Name } |
12 | plr:Kick( "You have violated the walk speed limit." ) |
13 | end |
14 | end ) |
15 | end ) |
16 | end ) |