Hello,
can I stop function after first “if” succeed?
do I need to use “return”?
function weapon1f( event )
if hero.selectedWeapon == 2 then
weapon1.fill = { type = "image", filename = "Images/selected.png" }
weapon2.fill = { type = "image", filename = "Images/notSelected.png" }
hero.selectedWeapon = 1
end
if hero.selectedWeapon == 0 then
weapon1.fill = { type = "image", filename = "Images/selected.png" }
hero.selectedWeapon = 1
end
if hero.selectedWeapon == 1 then
weapon1.fill = { type = "image", filename = "Images/notSelected.png" }
hero.selectedWeapon = 0
end
end