i'm currently making a Away-From-Keyboard plugin but i need to check if the player moves. i made this loop:
but once it starts it never stops. even if i walk. and it kind of destroys the server becouse the server is only working on the loop. does anyone know how to fix it?
btw the X and Y and Z are coordinates that are put in once the player uses /afk
I also used:
1 2 3 4 5 6 7 8 9 | PlayerMoved = 0 repeat if not ( X == Player:GetPosX() ) and ( Y == Player:GetPosY() ) and ( Z == Player:GetPosZ()) then PlayerMoved = 1 Player:SetName( Name[Player:GetName()] ) Server:SendMessage( Player:GetColor() .. Player:GetName() .. cChatColor.White .. " is back" ) end LOG( "TEST" ) until PlayerMoved == 1 |
btw the X and Y and Z are coordinates that are put in once the player uses /afk
I also used:
1 2 3 4 | while not ( X == Player:GetPosX() ) and ( Y == Player:GetPosY() ) and ( Z == Player:GetPosZ()) do Player:SetName( Name[Player:GetName()] ) Server:SendMessage( Player:GetColor() .. Player:GetName() .. cChatColor.White .. " is back" ) end |