|
| 09 Mar 2015 09:51 PM |
Ok so I'm trying to make a script where if one of two options are fulfilled, the script will move on.
The 2 Options:
A team scores; The time runs out
-- give conditions for game end local hint = Instance.new("Hint", workspace) for i = 300, 1, -1 do wait(1) timer.Value = timer.Value - 1 hint.Text = timer.Value end
Timer is a value I'm going to use to check if its value == 0
The scored will be triggered when a bool value is true
Not sure how to add all of that, though |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Mar 2015 10:03 PM |
if timer == 0 then break end
Would break your for loop. similar option could be done for finding your bool value. Probably something more elegant out there but this should work. |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 10:12 PM |
Like, I want like a
if timer.Value == 1 then
elseif scored.Value == true then
or something like that idk |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 10:15 PM |
My problem is
for i = 300, 1, -1 do wait(1) timer.Value = i hint.Text = timer.Value end
I have to run this code, while also checking for the conditions of winning |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 10:17 PM |
| Coroutines, or the spawn function. |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 10:18 PM |
| Never used them, how do they work? |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 10:22 PM |
The wiki tells you.
Use Google. site:wiki.roblox.com spawn
site:wiki.roblox.com coroutine |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 10:49 PM |
local hint = Instance.new("Hint", workspace) local changehint = coroutine.wrap(function() for i = 300, 1, -1 do wait(1) hint.Text = i end end) local detectscore = coroutine.wrap(function() repeat wait() until timer.Value == true end)
Um would this work |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
| 10 Mar 2015 10:47 AM |
| So how do I stop one if one of them is equal to 1 or one is true |
|
|
| Report Abuse |
|
|
| |
|
| |
|