so im trying to make a 1v1 game and got stuck at making the gamemode
so anyway i need help trying to make my while true loop do anything
local players = game:GetService("Players") local tPlace1Runnnig = game.Workspace.TrackingPlace1:WaitForChild("Running") local tPlace2Runnnig = game.Workspace.TrackingPlace2:WaitForChild("Running") local playerReadyTable = {} for _,player in pairs (players:GetPlayers()) do player.CharacterAdded:Connect(function(character) while true do -- here wait(3) print("help") print(#playerReadyTable) if character.IsPlaying.Value == false then table.insert(playerReadyTable, character.name) end end end) end
there are no output
any help would be appreciate it
Because the while loop is active it keeps doing the stuff inside that loop and does nothing else.
local players = game:GetService("Players") local tPlace1Runnnig = game.Workspace.TrackingPlace1:WaitForChild("Running") local tPlace2Runnnig = game.Workspace.TrackingPlace2:WaitForChild("Running") local playerReadyTable = {} for _,player in pairs (players:GetPlayers()) do player.CharacterAdded:Connect(function(character) spawn(function() while true do -- here wait(3) print("help") print(#playerReadyTable) if character.IsPlaying.Value == false then table.insert(playerReadyTable, character.name) end end end) end) end