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

How do i make it print the greater number?

Asked by 10 years ago

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?

0
You need to use a double set of equal signs when comparing. So line 5 would be `if HumanArms + HumanArms == 4 then`. FearMeIAmLag 1161 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
if (HumanArms + HumanArms == 4) then

you posted this

if (HumanArms + HumanAmrs = 4) then

compare both scripts and check your mistake.

0
Vote for my answer!!!! >=( biocommand 30 — 10y
0
Ok so no votes..... Scripting Helpers staff where are you when I need you!!!!! >=( I can´t report this question. biocommand 30 — 10y
0
I accepted it. Sorry because I was offline. Roboy5857 20 — 10y
Ad

Answer this question