function casesUpdate()
if getPressed() == 'Case1' then
selectedCase = images.cases.case1
first = true
load = 'case_open'
end
if getPressed() == 'Case2' then
selectedCase = images.cases.case2
first = true
load = 'case_open'
end
.. code continues..
If I click Case1 in game, it does someting, but Case2 does nothing (getPressed() always returns correctly).
Simply, it only reacts on a first if statement. If I put Case2 as first if, it only reacts to Case2. Any help please ?
function casesUpdate()
local pressed = getPressed()
if pressed == 'Case1' then
selectedCase = images.cases.case1
elseif pressed == 'Case2' then
selectedCase = images.cases.case2
end
first = true
load = 'case_open'
end
In case this solves your problem, think about why it does, otherwise that error might happen again.