Problem is that if there were variations of conveyor speeds then what is the point of that?
Thatâs not how or statements work. That will kick the player every time. Look on the Dev hub on how or statements work.
What you are doing right now in pseudo code:
(Walkspeed is not equal to white list speed 1) or (white list speed 2 exists)
Whitelist speed 2 always exists
Sorry to inform, but it takes an exploiter way less time to delete this script then it takes you to write it. Anti cheats on the client are never a good option. An exploiter can simply delete or disable your scripts.
In addition, exploit detection scripts based off any information provided by the client should never be trusted as anything the client tells you can be easily manipulated. As @Sensei_Developer stated on their reply, you should be worrying about making server protection instead.
I suggest you check out this post. Itâs one of the greatest community resources ever posted in the developer forum.
I have literally said about 50 times, THIS IS ON THE SERVER. Please read the whole post and replies, as I did state this quite a few times.
If you would like to try the script yourself, just copy and paste into studio on the server. I can assure you, it will work. If you change walk-speed on the client and walk, it will kick you, but if you change on the server, it wonât.
local whitelistedSpeed1 = 16
local whitelistedSpeed2 = convoyorspeedhere
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local hum = character:WaitForChild("Humanoid",30) -- wait 30 before declare (infinity yield with waitforchild and continue withoud ever finding it)
if not hum or not hum:IsA("Humanoid") then
-- to make sure player didnt rename his humanoid or remove it or renamed it and name somthing else humanoid cause it replicated to the server from what i heard with roblox characters
--kickhere (warning if hes legit and takes longer then 30 seconds to spawn he also get kicked increase to ur liking)
elseif hum.WalkSpeed ~= whitelistedSpeed1 or hum.WalkSpeed ~= whitelistedSpeed2 then
--kick() --some speedy boy
end
end
end)
end)
exploiters can destroy any individual object in their characters, including non-physical items like decals, joints, and scripts, and that destruction replicates to the server.
this is only for character so keep that in mind so make sure to add checks in case he tries to break ur script by changing names or removing stuff
probaly forgot something
I still canât grasp on why you still need an anti-exploit for, I presume, a tycoon game. Unless there is a PVP or items dropped randomly in random places, anti-speed is useless if it is a tycoon game that only requires you to place machines.
There are multiple ways to detect sudden change in speed, however these have its downside as well.
- Velocity check
- Probably the most used method. If the overall velocity of the HumanoidRootPart is greater than the average velocity, it could be well count as anti-speed. However, I am not sure if a conveyer can directly affect this velocity check. Also, if there are perks that increases the speed of the player or if you allow flying, then this method will probably not work unless you know the formula for calculating the average velocity of the HumanoidRootPart.
- Magnitude check
- This can be done on the server. Compare the magnitude of the previous Position of the HumanoidRootPart and the latest Position of the HumanoidRootPart. If their distance is not in the average, then it could be count as an speed exploit. The biggest downside to this is the replication of the character, or basically lag.
It is impossible to make a perfect anti speed exploit. The best way to prevent exploit is to secure your algorithms; always check on the server for player inputs like purchasing.
No, I am making an obby, so I obviously donât want people to speed through it. For more info, see this post I made, where you can see more of the game: Horizontal position bar not working properly
what about teleport for _,v in pairs(folderwithcheckpoints:GetChildren()) do
âgame.Players.LocalPlayer.Character:SetPrimaryPartCFrame(v.CFrame)
i know this ainât complete but the point is teleport is waaay more of a priority for an obby then speed hacks
in my opinion a speed hack or jumpower is a obby is not somthing u have to worry about its not a competitive game with global leaderboard or something
Sorry, but what is this code for?
for teleporting u need to check 2 positions between interval if distance is too big for a player to be legit traveled with a bit of extra for margin for lag then hes teleporting
something like that