cole7778
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 7827 |
|
|
| 18 Sep 2014 11:24 PM |
I just can't get it to work. Someone told me to use it to check for multiple things all at once. Can someone tell me what im doing wrong? There is no output.
function EveryoneDies() if #players <= 0 then end end
function TimeRunsOut() script.Time.Value = 0 end
function PeopleKillABoss() bosshealth = 0 end
while wait() do if EveryoneDiedCondition then ED = coroutine.wrap(EveryoneDied);ED(); script.Parent:Destroy() game.ServerScriptService.RoundReady.Value = true
elseif TimeRunsOutCondition then TRO = coroutine.wrap(TimeRunsOut);TRO(); script.Parent:Destroy() game.ServerScriptService.RoundReady.Value = true
elseif PeopleKillABossCondition then PKAB = coroutine.wrap(PeopleKillABoss);PKAB(); script.Parent:Destroy() game.ServerScriptService.RoundReady.Value = true
|
|
|
| Report Abuse |
|
|
cole7778
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 7827 |
|
| |
|
|
| 19 Sep 2014 01:09 PM |
why don't you use coroutine.wrap(function)()
anyway, if you're working with alot of if statements and there's no output, whilst it isnt doing what it is supposed try running it with alot of prints so you can see where it exactly stops and fix that if statement that would block stuff to be done correctly |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 19 Sep 2014 01:15 PM |
If you want to check for multiple things at once, just use and in the condition. Like, if a==2 and b and not c then just checks for all of those conditions being true. If you need just one of them to be true, use or instead. |
|
|
| Report Abuse |
|
|