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: What's a boolean?

Previous Thread :: Next Thread 
Samaraandsonic is not online. Samaraandsonic
Joined: 06 Oct 2012
Total Posts: 1402
25 Mar 2015 03:04 PM
Title
Report Abuse
AntiFiter is not online. AntiFiter
Joined: 14 May 2009
Total Posts: 12290
25 Mar 2015 03:05 PM
a true or false value
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Mar 2015 03:05 PM
a true or false value

for simple questions like these, go to the wiki.

http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting

Report Abuse
Dodeca is not online. Dodeca
Joined: 11 Sep 2011
Total Posts: 13649
25 Mar 2015 03:06 PM
boolean, bool value

just means true or false

you can use it in loops like while loops
while true do
end

or you could do

game.Workspace.Part.Transparency = 1
while game.Workspace.Part.Transparency = 1 do
print(hi)
wait(2)
end

Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Mar 2015 03:06 PM
http://wiki.roblox.com/index.php?title=AllTutorials
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
25 Mar 2015 03:07 PM
A boolean is variable that can be only two values. Either true or false. Booleans can be used to detect certain events.

A common use of booleans is for debounces.
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
25 Mar 2015 03:12 PM
"game.Workspace.Part.Transparency = 1
while game.Workspace.Part.Transparency = 1 do
print(hi)
wait(2)
end"

2 errors
Report Abuse
LucasLua is not online. LucasLua
Joined: 18 Jun 2008
Total Posts: 7386
25 Mar 2015 03:12 PM
Three errors*
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
25 Mar 2015 03:13 PM
OP think of it like an off on switch

you can have two possible values

on (true) or off (false)

you can use a boolean value (bool) whenever you want to have 2 possible values

Report Abuse
LucasLua is not online. LucasLua
Joined: 18 Jun 2008
Total Posts: 7386
25 Mar 2015 03:13 PM
Mostly because it assumes there is a part lololo
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
25 Mar 2015 03:14 PM
thats not an error
Report Abuse
LucasLua is not online. LucasLua
Joined: 18 Jun 2008
Total Posts: 7386
25 Mar 2015 03:20 PM
Booleans are either true or false. If you've ever heard about how computers think in binary which is 1s and 0s, booleans are our human-readable equivalent to that.

Lua, like all good computer languages, gives us logic expressions in comparing and evaluating booleans. For example:

a = true
b = true

if a and b then
print("A and B are both true!")
end

if a or b then
print("One (or both) of them are true!")
end

print(a and b)
>true

print(a or b)
>true

the statement "a or b" in Lua is like doing math in Lua, like 1 + 1. The statement evaluates to a boolean expression, and therefor:

a = true
b = false
c = a and b
d = c or b

print(a)
print(b)
print(c)
print(d)

> true
> true
> false, both of them must be true.
> false, because none of them are true, and at least one must be true for or expressions.

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