Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a simple exploit prevention system?

Asked by 4 years ago

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!

0
I believe you cannot run a Kick() from a localplayer, or maybe it's just the wait(60) in the line. Qariter 110 — 4y
0
I think Heartbeat event will work better(https://developer.roblox.com/en-us/api-reference/event/RunService/Heartbeat). It will fire everytime a new frame create. And we can use :Kick() from LocalScript. Block_manvn 395 — 4y
0
No you can't DeceptiveCaster 3761 — 4y
0
Wait, what? The document said that you CAN kick a player by LocalScript https://developer.roblox.com/en-us/api-reference/function/Player/Kick Block_manvn 395 — 4y
View all comments (2 more)
0
You can kick a player in a localscript, you just can only kick yoursell. hiimgoodpack 2009 — 4y
0
You can check for abnormalities in the character or player's behavior, and using a whitelist you can bypass the abnormalities. If it's not supposed to happen, add their name to a ban list using data store, and kick them. killerbrenden 1537 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

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.

0
? I am new to scripting. PrismaticFruits 842 — 4y
0
If you’re new to scripting, I don’t recommend trying to make an exploit prevention system. It’s not as simple as checking if a few variables are higher than they should be. It’s about replicating the physics of the game on the server-side and checking if the player’s character’s position or whatever you’re trying to prevent closely corresponds to the estimated calculations made on the server. joshmatt2244 28 — 4y
0
But you have the walkingspeed already in the players traits.... Unless exploiters change the walkingspeed without changing the value of the walkspeed in the player 0.o SethHeinzman 284 — 4y
0
you can change the walking speed without changing the walking speed... you simply make your own walking script. joshmatt2244 28 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

Answer this question