ServerSided Anti-Cheat

type ```
this will make a Lua Code Block

1 Like

Try this, it will most likely work @DeveloperSiverity

ServerScriptService or starterPlayerScripts?

as myaltsthis said this script cant stop exploiting because it checks when player joined , exploiters will change the speed later isnt it wrong?

I would recommend ServerScriptService so that Hacker’s wont delete it.

Exactly what I was thinking, it needs to be either in a .Running function or a loop of some sort

did this script worked? i made a .Running function

true, i was thinking in StarterPlayerScript, To Check the Humanoid’s Walk Speed and Send it to the Server via Remote Event, So if the Player Walkspeed Doesn’t Match >20 then
to Kick the Player

yes! good idea but exploiters can delete it , i think

I believe my last idea should work, checking the last position every second compare to the current position in Magnitude, then checking if that is greater than the player’s walkspeed should work. Like this:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local HRP = char:WaitForChild("HumanoidRootPart")
		local lastpos
		wait()
		while wait(1) do
			if not lastpos then
				lastpos = Vector3.new(HRP.CFrame.Position.X, 0, HRP.CFrame.Position.Z)
			else
				local magnitude = math.round((lastpos - Vector3.new(HRP.CFrame.Position.X, 0, HRP.CFrame.Position.Z)).Magnitude)
				lastpos = Vector3.new(HRP.CFrame.Position.X, 0, HRP.CFrame.Position.Z)
				if magnitude > char.Humanoid.WalkSpeed then
					plr:Kick("Speed hacking")
				end
			end
		end
	end)
end)

Of course, in a server script.

4 Likes

Then I Could do

if script.Parent:Destroy() == true then
game.ReplicatedStorage.OnDestroyed:FireServer()
end```

And Automatically the Server gets the Name of who Fired that RemoteEvent
then Proceed to kick them

You know, if hackers really can send a walkspeed over from the client, and it would not replicate from the server, you can probably detect it some other way, such as with MoveDirection.Magnitude, or with the humanoid rootpart’s velocity. You should probably also involve Kaid3n22’s method if you want

4 Likes

That Could Work, But I Don’t Really Know how to use
moveDirection.Magnitude or Velocity’s

1 Like

The server can kick players. The wiki doesn’t say that you can’t.

1 Like

You Always Couldv’e Kicked the Player From Server Side Right?

If it was Local Script, then Who says a Exploiter Can’t Kick Everyone from the game

I posted a code block in my last post, you could use that.

Okay i’ll Check it out right now.

Yes, you can use the function on the client, but you only kick the LocalPlayer.