So basically, I work for this guy named MontanaCentral. @MontanaCentral, and we are in a group called TRI (The Red Isles). Our game, Fort Henry, is flooded consistently with exploiters and to solve this we used an antisploit, better known as anti exploit script. It works on a baseplate, but when it comes to our game it doesn’t work. I have no idea whats wrong, FE is on, and it sends the player back to the place where their exploit first began usage.
Here is the script:
local maxspeed = 22 --The maximum distance the player can travel within a check time. Try to keep this higher than 16. local checktime = 1 --How many seconds we wait before we record their speed. --If we make checktime too fast, like ".1", the script will be recording positions too fast and thus will fail to work correctly! local root = script.Parent:WaitForChild("HumanoidRootPart") --Get HumanoidRootPart so we can keep track of the player's position. local lastcf = root.CFrame --We will store the player's CFrame so that we can move the player there if they seem to be hacking. --Main logic: while wait(checktime) do if math.floor((Vector3.new(lastcf.p.X, 0, lastcf.p.Z) - Vector3.new(root.Position.X, 0, root.Position.Z)).magnitude) > maxspeed then --We compare the length of the last known position, lastcf.p, with the current position, root.Position. If it's greater than maxspeed, they're hacking. --See how we ignored the Y axis in the calculation? Also notice how we rounded on the line above? This prevents an inaccurate reading. print("Hack detected for "..script.Parent.Name.."!") root.Parent:SetPrimaryPartCFrame(lastcf) --The player is hacking! Because this could be a false positive, we DO NOT KICK THE PLAYER. Instead, we peacefully move them back to their last known valid position! end lastcf = root.CFrame --We store the player's position so we can see if they're hacking later! end --And we're done. Pretty simple, huh?