Script Won't return to back to the lobby?
Hello I have a problem with my roundscript
It is a really big script so I will show you a piece of it
Btw when I set players to 1 (not 2) it works (In roblox studio)
But when I set players to 2 it won't work.
01 | status.Value = "Be The Last Standing!" |
03 | game.Workspace.Sound:Stop() |
08 | status.Value = "Time is up!" |
13 | if #_G.gameplayers = = 1 then |
14 | for i, v in pairs (_G.gameplayers) do |
16 | status.Value = v.. " Won The Game!" |
17 | game.Players [ v ] .leaderstats.Cash.Value = game.Players [ v ] .leaderstats.Cash.Value + 15 |
24 | status.Value = i.. "..Seconds Remaining!" |
27 | for i, player in ipairs (game.Players:GetPlayers()) do |
28 | if player.Character then |
29 | local hum = player.Character:FindFirstChild( 'Humanoid' ) |
36 | mapstorage:ClearAllChildren() |
I used this script so they would teleport to the lobby ~~~~~~~~~~~~~~~~~
for i, player in ipairs(game.Players:GetPlayers()) do
if player.Character then
local hum = player.Character:FindFirstChild('Humanoid')
if hum then
hum.Health = 0
end
end
end
~~~~~~~~~~~~~~~~~
Every thing in the script works except that they will return to the lobby. Any solutions?