local plr = game.Players:GetPlayers() for i,v in pairs (plr)do table.insert(_G.Playing,v) -- Inserting Player into table print(v.Name..' is _G.Playing') end for i,v in pairs (_G.Playing)do local char = v.Character local human = char:WaitForChild('Humanoid') if char and human then workspace.Values.Status.Value = 'The next gamemode is Classic!' wait(3) for i,chars in pairs (_G.Playing) do teleport.telePlayers(chars,workspace:WaitForChild'Spawn') -- Teleport to arena end status.Value = 'Simple, everyone gets a basic sword and fights to be the last one alive! Get Ready!' wait(8) status.Value = 'Giving every player their sword...' for i,back in pairs (_G.Playing) do giveWeapon.giveWeaponToPlayers(back,game:GetService('ReplicatedStorage').Tools.Sword) end end wait(3) end status.Value = 'Kill every player and be the last one standing to win!'
Yes, i have posted this a while ago, but no one helped it so i was hoping someone can help me with this, basically what happens is just keeps doing this code over and over again and doesnt allow the rest of the script to execute. Any answers with explanations are happily requested!
moved the end you had on line 14, it should work now
local plr = game.Players:GetPlayers() for i,v in pairs (plr)do table.insert(_G.Playing,v) -- Inserting Player into table print(v.Name..' is _G.Playing') end for i,v in pairs (_G.Playing)do local char = v.Character local human = char:WaitForChild('Humanoid') if char and human then workspace.Values.Status.Value = 'The next gamemode is Classic!' wait(3) for i,chars in pairs (_G.Playing) do teleport.telePlayers(chars,workspace:WaitForChild'Spawn') -- Teleport to arena status.Value = 'Simple, everyone gets a basic sword and fights to be the last one alive! Get Ready!' wait(8) status.Value = 'Giving every player their sword...' for i,back in pairs (_G.Playing) do giveWeapon.giveWeaponToPlayers(back,game:GetService('ReplicatedStorage').Tools.Sword) end end end wait(3) end status.Value = 'Kill every player and be the last one standing to win!'