script problem[SOLVED]
Posted: Sun Jul 06, 2014 1:05 am
Hello. I have probably stupid problem in my script. I created 3 buttons(1,2,3) and 3 spawners(1,2,3) my purpose was to open a gate after proper combination(2,3,1) and punish player(with poison cloud in the face) when he perpetrate a mistake.
counter_1 has initial value = 3
every click on the button should run the script
Can sb halp ?
Code: Select all
function buttonPress(sender)
if sender.id == "wall_button_1" and counter_1:getValue() == 3 then
counter_1:setValue(3)
spawner_1:activate()
elseif sender.id == "wall_button_1" and counter_1:getValue() == 2 then
counter_1:setValue(3)
spawner_1:activate()
elseif sender.id == "wall_button_1" and counter_1:getValue() == 1 then
counter_1:setValue(0)
elseif sender.id == "wall_button_2" and counter_1:getValue() == 3 then
counter_1:setValue(2)
elseif sender.id == "wall_button_2" and counter_1:getValue() == 2 then
counter_1:setValue(3)
spawner_2:activate()
elseif sender.id == "wall_button_2" and counter_1:getValue() == 1 then
counter_1:setValue(3)
spawner_2:activate()
elseif sender.id == "wall_button_3" and counter_1:getValue() == 3 then
counter_1:setValue(3)
spawner_3:activate()
elseif sender.id == "wall_button_3" and counter_1:getValue() == 2 then
counter_1:setValue(1)
elseif sender.id == "wall_button_3" and counter_1:getValue() == 1 then
counter_1:setValue(3)
spawner_3:activate()
end
endevery click on the button should run the script
Can sb halp ?