I got a bug with afk. I have this script in ServerScriptService:
while true do
for _,v in pairs(game.Player:GetChildren()) do -- i also tried with "GetPlayers()"
if v.afk.Value then -- boolean afk value
print("player is afk but it still teleports him because of")
else
v.Character:MoveTo(workspace.Spawn.Position)
end
end
end
The player is teleported even if he has afk mode turned on, that is, boolean value. I think the problem is with “while true do” but I don’t know what exactly, I tried to add afk mode in way “StarterPlayer > StarterCharacterScripts” (like in character) but the same thing happened
while true do
for _,v in pairs(game.Player:GetChildren()) do -- i also tried with "GetPlayers()"
if v.afk.Value == true then -- boolean afk value --and set the obj value to true and see if it works
print("player is afk but it still teleports him because of")
else
v.Character:MoveTo(workspace.Spawn.Position)
end
end
end```