|
| 20 Jun 2014 06:28 PM |
while true do game.Players.PlayerRemoving:connect(function(player) if player.Name=="Player1" then print(player.Name.." has left.") break end --no loop to break near 'end'
game.Workspace.games.Text = "Wave 1: "..20 - Workspace.numofzombies.Value.." Zombies left." wait(0)
elseif Workspace.numofzombies.Value == 20 then game.Workspace.games.Text = "You beaten Wave 1! Next wave!" break end end
if player1 leaves, it will break the loop. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 07:40 PM |
while true do wait(.1) game.Players.PlayerRemoving:connect(function(player) if player.Name=="Player1" then print(player.Name.." has left.") break end
game.Workspace.games.Text = "Wave 1: "..20 - game.Workspace.numofzombies.Value.." Zombies left." wait(.1)
elseif game.Workspace.numofzombies.Value == 0 then game.Workspace.games.Text = "You beaten Wave 1! Next wave!" break
end end)
try this |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 07:42 PM |
| Why do you have a function connection inside a while-do loop and why do you have a break inside a function? |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Jun 2014 07:44 PM |
| Actually, its more a case of "What is going on here?" :P |
|
|
| Report Abuse |
|
|
| |
|