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

How do i make it print the greater number?

So I have a script of Human ARMS and Animal ARMS. Human Arms = 2 Animal Arms = 4. I want it to print 4. But in the output it says 21:42:49.144 - Workspace.Script:5: ')' expected near '='. Why?

local HumanArms = 2

local AnimalArms = 4
-- Human Arms + Human Arms = Animal Arms which is 4. 2+2 =4.
if (HumanArms + HumanAmrs = 4) then
	print("2+2=4")
	wait(2)
	print("Human Arms + Human Arms = Animal Arms which is 4. 2+2 = 4.)
	
else
	print("2+2 is not 4. Human Arms + Humans Arms is not 4.
end

It says Line 5 is wrong. Why?

1 comment

0

You need to use a double set of equal signs when comparing. So line 5 would be if HumanArms + HumanArms == 4 then.

1 answer

✓ Accepted answer
if (HumanArms + HumanArms == 4) then

you posted this

if (HumanArms + HumanAmrs = 4) then

compare both scripts and check your mistake.

3 comments

0

Vote for my answer!!!! >=(

0

Ok so no votes..... Scripting Helpers staff where are you when I need you!!!!! >=( I can´t report this question.

0

I accepted it. Sorry because I was offline.

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