| |
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 25 Mar 2015 03:06 PM |
| http://wiki.roblox.com/index.php?title=AllTutorials |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
| |
|
|
| 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
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 25 Mar 2015 03:13 PM |
| Mostly because it assumes there is a part lololo |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|