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: if true

Previous Thread :: Next Thread 
USAGroupHolder is not online. USAGroupHolder
Joined: 26 Jul 2013
Total Posts: 513
16 Feb 2014 11:52 AM
I want if a bool value is true in workspace that it continues a script. if it is false it does a certain thing. How would I do that?
Report Abuse
SFOH is not online. SFOH
Joined: 01 Nov 2009
Total Posts: 293
16 Feb 2014 11:54 AM
Check for the BooleanValue's value.

If workspace.bool.Value then--bool is true
--do something
else
--do something else because its false
end
Report Abuse
USAGroupHolder is not online. USAGroupHolder
Joined: 26 Jul 2013
Total Posts: 513
16 Feb 2014 11:54 AM
Thanks
Report Abuse
Gorake is not online. Gorake
Joined: 10 Feb 2014
Total Posts: 219
16 Feb 2014 11:55 AM
Lucky for you, there are things called 'conditional statements' in Lua, and they're almost exactly the same as english.

You said: if a bool value is true, do one thing. Else if it is false, do another.

In Lua, that would be:

local bool = Workspace.BoolValue
if bool.Value == true then
--Continue
else
--Do specific thing
end

BTW, you don't even need the == true part, this would work too:

if bool.Value then
--Continue
else
--Do something else
end
Report Abuse
USAGroupHolder is not online. USAGroupHolder
Joined: 26 Jul 2013
Total Posts: 513
16 Feb 2014 11:55 AM
Wait would it continue to do that? Like loop. I am making it for a round timer.
Report Abuse
SFOH is not online. SFOH
Joined: 01 Nov 2009
Total Posts: 293
16 Feb 2014 11:57 AM
@Gorake good job copying my post
Report Abuse
Gorake is not online. Gorake
Joined: 10 Feb 2014
Total Posts: 219
16 Feb 2014 11:59 AM
USA, use a while loop if you want something to happen over and over. Read up on them here:
http://wiki.roblox.com/index.php?title=Loops#While
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
16 Feb 2014 12:01 PM
yeah USA you need to read up your questions are so self explanitory
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