Lua Code error

danieljdavies8

Prominent
Dec 27, 2017
1
0
510
0
Hey everyone,

I know it may not be the perfect place to ask for this but I do not know where else to ask this question.

I am currently making a mobile game that is written in lua. I want it so that if the player is in a certain place, it will change the background (different town, forest, etc).

This is the code that I have written for this but it doesn't work.

if ((player.x <= display.contentHeight / 3.8) and (player.x >= display.contentHeight / 3.5) and (player.y >= display.contentWidth / 100)) then
enteredViridisTown = 0
enteredViridisTown2 = 1
enteredViridisForest = 0
end

I have a few if statements that will change the backgrounds according to the variable change.
Is there anything that I could do to fix this?

Thank you
 
Thread starter Similar threads Forum Replies Date
M Mobile Gaming 1
A Mobile Gaming 1
H Mobile Gaming 1
J Mobile Gaming 1
J Mobile Gaming 1
K Mobile Gaming 1
S Mobile Gaming 2
M Mobile Gaming 1
F Mobile Gaming 5
L Mobile Gaming 2
H Mobile Gaming 1
B Mobile Gaming 2
C Mobile Gaming 1
7 Mobile Gaming 3
S Mobile Gaming 3
R Mobile Gaming 10
C Mobile Gaming 1

ASK THE COMMUNITY

TRENDING THREADS