local Character = game.Players.LocalPlayer.Character
local CharPos = Character.HumanoidRootPart.Position.X
for i = 1,10 do
if CharPos > CharPos * 2 == true and i == 10 then
game.Players.LocalPlayer:Kick("cool")
end
print(CharPos)
if CharPos > CharPos * 2 == not true and i == 10 then
return i
end
end
i'm pretty sure im doing something here completely wrong but what im trying to do is have a timer of 1 to 10 and when it reaches 10 it checks if the Character position is bigger then what it was before and if it is then kick the player and if it isnt than restart the count its kind of an anticheat but ik its really bad but why does it not work?

6 comments
Theres no wait in the loop so all the checks would be almost instant, and you should just do CharPos > CharPos*2
What exactly do you mean by "bigger"?
if CharPos > CharPos * 2, if the position is X 2 bigger than what it was.add a wait in the function so checks would not be done in one fraction of a second.
Do you mean they moved further???!! Be more descriptive.
"return" would not work here, but "break" would.