# How do I Check if a tile is a lava tile

Get help using Construct 2

### » Thu Jan 12, 2017 3:15 pm

Hi I am trying to check if the tile on the tilemap at the right of the player sprite is a lava tile
ofcourse i can make allot of conditions saying: compare tile at (player.X/playerSize)+1,player.Y/playerSize = NumberOfTheTile

but i want to check if the tile is a lava tile currently my lava tiles have number 2, 5, 8 and 11

I was thinking if there was a expression to make one conditions saying: compare tile at (player.X/playerSize)+1,player.Y/playersize = Expression(2,5,8,11)
but i cant find it anywhere
B
8
Posts: 9
Reputation: 296

### » Thu Jan 12, 2017 4:15 pm

Sorry I didn't really read the beginning lol. So I'm sure this isn't what you were looking for. I do that sometimes.
B
25
S
4
G
1
Posts: 47
Reputation: 1,723

### » Thu Jan 12, 2017 4:27 pm

I dont think I understand what you are trying to do.
I am trying to check if a tile is either 2,5,8 or 11.
but currently i have to do this:
B
8
Posts: 9
Reputation: 296

### » Thu Jan 12, 2017 4:30 pm

basicly i want to be able to have only one block instead of 4
for example by using a expression: X Tile((sprite.X/32)+1, (sprite.Y/32)) = ???(2,5,8,11)
B
8
Posts: 9
Reputation: 296

### » Thu Jan 12, 2017 4:39 pm

You can "write" your own expression using a function.

And then, you use it like this :
Compare Two Values
1st value : Function.Call("IsValuePresent", searchedValue, value1, value2, ...)
Equals
2nd value : 1
B
81
S
33
G
27
Posts: 1,029
Reputation: 21,143

### » Thu Jan 12, 2017 4:50 pm

thanks i will try that
B
8
Posts: 9
Reputation: 296