Functions in Booleans

// Will this work??

if boo then
function boofunction()
boouno = “True!”
end // The thing i’m wondering about is if once the function is ended, do you have to put
// extra spaces before the “end” because it’s in a boolean??
print (boouno)
else
function boodosfunction()
boodos = “False:(”
end // <-- Ends boodos function

print (boodos)
end // <-- Ends boolean

Err… what? I have absolutely no clue what you’re trying to do or what you need help with.

Booleans are either false or true, they aren’t strings or anything.

1.) Use [noparse][lua][/lua][/noparse] tags.
2.) Tab your code.

This will make it easier for people to help you.

ok, i’m trying to get the code to print “True” to the console if the boolean is true, and “False” if it’s false, by using variables and functions within the boolean. I know this may be totally wrong, but…

[lua]
if boo then
function boofunction()
boouno = “True!”
end

print (boouno)
else
function boodosfunction()
boodos = “False:(”
end

print (boodos)
end
[/lua]

Err, I think this is what you’re looking for?


if boo == true then print("True") else print("False") end

oh ok. yeah, that works. I didn’t know you could print stuff by just saying print("…"), i thought it had to be defined by a variable.

one more thing: does it matter how many spaces/new lines you put before an “end” or start of another function? Or is it ok to just put everything on one line?

Sure, you don’t REALLY need new lines or indents, but it helps organize your code.