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 » Scripters
Home Search
 

Re: This is confusing me, please help?

Previous Thread :: Next Thread 
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
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
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
09 Mar 2015 09:57 PM
b?
Report Abuse
xXxMaggzxXx is not online. xXxMaggzxXx
Joined: 01 Feb 2015
Total Posts: 40
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
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
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
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
09 Mar 2015 10:17 PM
Coroutines, or the spawn function.
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
09 Mar 2015 10:18 PM
Never used them, how do they work?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
09 Mar 2015 10:22 PM
The wiki tells you.

Use Google.
site:wiki.roblox.com spawn

site:wiki.roblox.com coroutine
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
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
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
09 Mar 2015 11:02 PM
b
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
09 Mar 2015 11:07 PM
b..
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
09 Mar 2015 11:20 PM
anyone? really
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
09 Mar 2015 11:31 PM
buuuuuuuuuuuuump
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
09 Mar 2015 11:40 PM
b
u
m
p
y
Report Abuse
FalconLoverGiraffe is not online. FalconLoverGiraffe
Joined: 24 Jun 2014
Total Posts: 456
10 Mar 2015 12:53 AM
yes
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
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
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Mar 2015 11:08 AM
b
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
10 Mar 2015 11:31 AM
bb
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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