Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 answers

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.