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
 

Can someone tell me what a boolean can be used for?

Previous Thread :: Next Thread 
Darkfireyice is not online. Darkfireyice
Joined: 09 May 2010
Total Posts: 10086
25 May 2012 10:53 PM
I'm learning how to script in RBX Lua and I'm currently learning about Booleans. I don't understand what they would be used for though. Just an example would work, I'm not looking for any code.
Report Abuse
nickmaster24 is not online. nickmaster24
Joined: 04 Oct 2008
Total Posts: 8906
25 May 2012 11:03 PM
if true then
print("this will print")
end

if false then
print("This won't print")
end

pizza = false

if pizza then
print("This won't print")
end


if (value == 3) then
print("Will print if value is equal to 3")
end
Report Abuse
200AB is not online. 200AB
Joined: 24 Aug 2010
Total Posts: 1604
25 May 2012 11:07 PM
a boolean is a true or false value, it can be used for like 3459839485983384599 things.
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
26 May 2012 12:33 AM
Booleans are used for all conditional statements (if, while, repeat). They can be used for on-off switches (on = true and off = false.) They're also good if you need to toggle an arbitrary value to signal the start or end of something.

value = true
value = not value

will toggle the value variable to the opposite value.
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
26 May 2012 08:39 AM
A boolean is either true or false, like for the brick property of Anchored, it is either yes or no (true or false). THat is a boolean value.

ex.
lalala=true
while lalala do
insert script here
end
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
26 May 2012 09:14 AM
A Boolean is a true/false or number value. Or even string value. So things like this:

Boolean = false
if Boolean==false then
Boolean=true
print("This is false")
end
if Boolean==true then
Boolean=false
print("This is true")
end

Now we use numbers.

Boolean = 0
if Boolean=="0" then
Boolean="1"
print("This is 0")
end
if Boolean=="1" then
Boolean="0"
print("This is 1")
end

And now we use strings.

Boolean = "Hi!"
if Boolean=="Hi!" then
Boolean="Bye!"
print("Hi!")
end
if Boolean=="Bye!" then
Boolean="Hi!"
print("Bye!")
end


MrMcAero
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
26 May 2012 09:14 AM
Boolean does mean true/false value, but can easily become a string or number value.

MrMcAero
Report Abuse
Darkfireyice is not online. Darkfireyice
Joined: 09 May 2010
Total Posts: 10086
26 May 2012 02:40 PM
pwn, Mr,

Thanks! Your posts helped me out the most.

Everyone else,

Thanks still!
Report Abuse
nickmaster24 is not online. nickmaster24
Joined: 04 Oct 2008
Total Posts: 8906
26 May 2012 05:59 PM
No Problem!
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