So this is what I have so far:
while true do wait(60) local plrs = game.Players:GetChildren() local chars = workspace:FindFirstChild(plrs.Name) if chars.Humanoid.Walkspeed >= 17 then local plr = game.Players.LocalPlayer plr:Kick("You were exploiting") end end
I was trying to make a thing that checks the players' walkspeed and if it is over 16 it kicks them. But this doesn't seem to work. Could someone please help me here? Thanks in advance!
For walking speed, you could calculate how many studs the player moved since the last frame and check how much time there has been between the last frame and the current and check if the player moved too much on the X and Y positions of the HumanoidRootPart. Although, for the Y positions, it would be much more complicated because the player can jump and fall. Also, you would have to account for any sort of moving platform (ie. car, train, etc) that moves in your game. If you have basic knowledge of physics, it should be easy. You should get familiar with roblox’s physics system if you want to make an anti-exploit script. That script you made will only prevent the player from changing the walk speed but there are alternatives like changing the position of the humanoid root part directly. If i’m not mistaken, anything that happens to the player’s character on the client side is replicated to the server. I don’t know if that’s entirely true but I’m pretty sure it is since animations are replicated automatically. If I am wrong, please correct me.
You could do a .Changed listener on the players walkspeed. If it changes then fire a even to the server to kick the player. I think..
You need a way to track the players walkspeed constantly. A while loop is not the way.