of     1   

badfitz67
#183761474Tuesday, February 16, 2016 5:31 PM GMT

if maxHealth > smaxHealth3 and health > smaxHealth3 then -- set shield local lmaxHealth = maxHealth s3 = health - smaxHealth3 ms3 = maxHealth - smaxHealth3 maxHealth = 0 -- maxhealth = 0 health = health - s3 -- health - shield print(s3) maxHealth = lmaxHealth -- maxhealth = lastmaxhealth end if maxHealth > smaxHealth2 and health > smaxHealth2 then -- set shield local lmaxHealth = maxHealth s2 = health - smaxHealth2 ms2 = maxHealth - smaxHealth2 maxHealth = 0 -- maxhealth = 0 health = health - s2 -- health - shield maxHealth = lmaxHealth -- maxhealth = lastmaxhealth end if maxHealth > smaxHealth and health > smaxHealth then -- set shield local lmaxHealth = maxHealth shield = health - smaxHealth -- health - setmaxhealth(100) maxHealth = 0 -- maxhealth = 0 health = health - shield -- health - shield maxHealth = lmaxHealth -- maxhealth = lastmaxhealth end These are my if statements for each stage of my shield system shown here: https://www.youtube.com/watch?v=vUUeM1YQoFs&user=badfitz66 bottom one being the yellow bar, green being the middle. I added the top just now. Is there any way I can condense this? What's Wolfgang McHairyback gonna do?
ReallyExpensive
#183763398Tuesday, February 16, 2016 6:08 PM GMT

i dont get it #code local answer = {"Yes","No"} print("The answer to your yes or no question is "..answer[math.random(1, #answer]..". You welcome.")
cheesecake123456
#183763595Tuesday, February 16, 2016 6:12 PM GMT

He wants to make the code shorter or more efficient.
badfitz67
#183763678Tuesday, February 16, 2016 6:13 PM GMT

I assume no one understands my code to be able to make it smaller. Neither do I (mostly, but it's really hard to explain) What's Wolfgang McHairyback gonna do?
cheesecake123456
#183763880Tuesday, February 16, 2016 6:17 PM GMT

It would help if you included the variable definitions :(
badfitz67
#183764135Tuesday, February 16, 2016 6:22 PM GMT

/hHm7QEcA (pastebin) doesn't have the third if statement but it's literally just copy and pasted then editted a little What's Wolfgang McHairyback gonna do?
badfitz67
#183766115Tuesday, February 16, 2016 7:01 PM GMT

b What's Wolfgang McHairyback gonna do?
CrustyCitation5
#183766465Tuesday, February 16, 2016 7:08 PM GMT

Idk if I got everything if maxHealth > smaxHealth and health > smaxHealth then local lmaxHealth = maxHealth health = health - shield if maxHealth > smaxHealth2 and health > smaxHealth2 then s2 = health - smaxHealth2 ms2 = maxHealth - smaxHealth2 health = health - s if maxHealth > smaxHealth 3 and health >smaxHealth3 then s3 = health - smaxHealth3 print(s3) ms3 = maxHealth - smaxHealth3 health = health - s3 end maxHealth = lmaxHealth end end You also have a problem because you're doing maxHealth = 0 then right after you're doing maxHealth = lmaxHealth. I'm not sure why.
CrustyCitation5
#183766531Tuesday, February 16, 2016 7:09 PM GMT

Oops that last maxHealth = lmaxHealth should be one end statement down.
badfitz67
#183771186Tuesday, February 16, 2016 8:31 PM GMT

Only does the first shield, the second and third shields don't work (their if statements aren't being ran either) What's Wolfgang McHairyback gonna do?
CrustyCitation5
#183772376Tuesday, February 16, 2016 8:48 PM GMT

gg

    of     1