Use player added event, and then use a for loop. Walkspeed doesn’t replicate from client to server so you are better off checking the velocity or the distance the player travelled from point A to point B.
Same goes for the jump power, it doesn’t replicate.
Never trust the client and always do anti exploit stuff on the server. A exploiter can just simply modify or delete the local script since it runs on their end.
You shouldn’t be harsh on exploiters until they really are causing havoc.
Here’s a simple demonstration.
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
-- for loop that loops through each player
end)
end)
Your game should be made in a way where speed and jump hacks are reducant.
because it will just be got destroy and creating new when player respawning
if you do like that player will just got kick with no reason.
Completed script: i guess?
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
died = false
char.Humanoid.Died:Connect(function()
died = true
end)
print('done')
repeat wait() while wait() do if char.Humanoid.WalkSpeed ~= 16 then plr:Kick("Why cheating bro") end if char.Humanoid.JumpPower ~= 50 then plr:Kick("Why you keep cheating") end -- <add more here! end until died == true
end)
end)
is done script
NOTE: Please make sure there is nothing that will decrease/increase player walk speed or jump power because this can’t know if it was done by who.
you can add more like maxhealth etc.
by using
if char.Humanoid.WalkSpeed ~= 16 then plr:Kick("Why cheating bro") end -- Change walk speed to property on humanoid you want! and change 16 to value that must be, see above then you will know where you should put it
Learn more about if statement if you wanna add more feature by click this
If you don’t understand you can let me know
Have a nice day and sorry for bad english.
local plr = game.Players.LocalPlayer
plr.CharacterAdded:Connect(function(char)
died = false
char.Humanoid.Died:Connect(function()
died = true
end)
print('done')
repeat wait() while wait() do if char.Humanoid.WalkSpeed ~= 16 then plr:Kick("Why cheating bro") end if char.Humanoid.JumpPower ~= 50 then plr:Kick("Why you keep cheating") end -- <add more here! end until died == true
end)