|
| 04 Jun 2014 04:05 PM |
This is trying to find if the killer is dead or the bystanders are dead.
local allPlayersDead = false local bossDead = false
function check() for i, collect in pairs (game.Players:GetChildren())do if collect.ClassName == "Player" then if collect.TeamColor == "Lime green" or collect.TeamColor == "Really red" then print("Running") else m = Instance.new("Hint") m.Parent = game.Workspace m.Text = 'Round Over' wait(60) m:Remove() end end end end
repeat check() until allPlayersDead or bossDead |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 04 Jun 2014 04:08 PM |
TeamColor is a BrickColor, not a String
That loop does not yield so the server/client will crash. |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2014 04:10 PM |
| Even if you put a wait() in the repeat until loop, it wont work because you call it every 1/60 of a second and there is a part of the function where it waits for 60 seconds. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 04 Jun 2014 05:52 PM |
| allPlayersDead and bossDead never gets updated, hence infinite loop. |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2014 06:04 PM |
| I would but idk how to scan if no players are under a certain team the change on of the values |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2014 06:06 PM |
instead of
repeat wait() check() until allPlayersDead or bossDead
use
coroutine.resume(coroutine.create(function() repeat wait() check() until allPlayersDead or bossDead end))
so that it doesnt pause the whole script with the loop |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2014 06:10 PM |
I didn't give u the whole script.
later this is ran
while wait(30) do repeat check() until allPlayersDead or bossDead |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2014 06:11 PM |
while wait(30) do repeat check() until allPlayersDead or bossDead end
Let me explain this. It waits 30 seconds and then sets off a repeat loop. After the loops finishes, you wait another 30 seconds and the loops is triggered again. Is that what you wanted..? |
|
|
| Report Abuse |
|
|
| |
|