Nevermind, I fixed the error:
Add the brackets. The problem is that lua is reading that left to right so it reads:if pad:left() and Player.jumpstate == "ground" and (Player.image == Playerp or Player.image == Playerp2) then
Player.image = Player2
Player.x=Player.x-4
end
if pad:right() and Player.jumpstate == "ground" and (Player.image == Playerp or Player.image == Playerp2) then
Player.image = Player1
Player.x=Player.x+4
end
if (a and b) or c
By putting the brackets round an expression means you are saying that it needs to be evaluated first before anything else. It falls down to order of operation. eg maths
a * b + c == (a * b) + c
but if you wanted b + c to be done first then:
a * (b + c)
Bookmarks