I'm having a problem with the last button that was pressed remaining active after it is released so that it triggers things later in my code.
Here is an example of what I mean.
--script: lua state = "one" function TIC()I've wrestled with this for awhile trying both btn and btnp but I haven't gotten anywhere. Any help would be greatly appreciated!
cls(0)
if btn(4) then
if state == "one" then
state = "two"
end
if state == "two" then
state = "three"
end
if state == "three" then
state = "one"
end
end
if state == "one" then
print("First state",0,0)
end
if state == "two" then
print("Second state",0,0)
end
if state == "three" then
print("Third state",0,0)
end
end