So I have a boolian named "AFK" in every character that joins (game.Players.etc...) but this script doesn't read it, how would I fix this, It doesn't give off any errors also.
Spawns = game.Workspace.Spawns Players = game.Players:GetPlayers() for PlayerTeleport = 1, #Players do if game.Workspace:FindFirstChild(Players[PlayerTeleport].AFK.Value) == false then Players[PlayerTeleport].Character.Torso.CFrame = Spawns[_G.StartingPlaces[math.random(1,#_G.StartingPlaces)]].CFrame * CFrame.new(0,8,0) else end end
Put this LOCALSCRIPT in the AFK value. That's all I can say.
Spawns = game.Workspace.Spawns player = game.Players.LocalPlayer repeat wait() until player.Character char = player.Character AFK = script.Parent AFK.Changed:connect(function() if AFK.Value == true then char.Torso.CFrame = Spawns[math.random(1, #Spawns:GetChildren())].CFrame * CFrame.new(0, 8, 0) end end)