generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Will not work!

Previous Thread :: Next Thread 
drslicendice is not online. drslicendice
Joined: 05 Mar 2011
Total Posts: 18737
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
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
20 Jun 2014 07:43 PM
Remove the breaks
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
20 Jun 2014 07:44 PM
Actually, its more a case of "What is going on here?" :P
Report Abuse
drslicendice is not online. drslicendice
Joined: 05 Mar 2011
Total Posts: 18737
20 Jun 2014 11:40 PM
Nevermind, fixed it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image