Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you 'end' a 'and', both commands?

Asked by 10 years ago

how do you 'end' a 'and', without causing an error?

2 answers

Log in to vote
2
Answered by
duckwit 1404 Moderation Voter
10 years ago

The correct syntactical terminator for the condition of an if statement is "then".

For example:

if a and b then 
    --Do something
end

Or, alternatively:

if a then
    if b then
        --Do something if a and b
    end
    --Do something if just a
end
Ad
Log in to vote
-1
Answered by 10 years ago

I hope this is what you were talking about, sorry if it isn't.

local Youdoyourmath = true

local a=NUM --Replace with number
local b=NUM --Replace with number
if a<b and Youdoyourmath then --If B > A (B over A) then
print(b) --Prints b
elseif a<b then --Elseif
print(a) --Prints a
end --The end for all the 'if' loops

Answer this question