So I'm making a sort of sandbox crafting game along the lines of Terraria and Starbound. I have a tilemap that has the blocks that I'm making the world out of. I currently have grass and dirt. What I would like to happen in the game, is when I click on grass, it adds a value to a global variable: "grass," and when I click on dirt, it adds a value to a global variable: "dirt." And when I place grass, it subtracts 1 from the "grass" variable, and same with dirt. The problem is, no matter what tile I click, it adds 1 to the variables I currently have set up, which are grass and dirt. I'm also confused because even if I click on nothing, as long as it's within the tilemap's borders, it'll still add 1 to the grass and dirt variables. In the current game, I have in the event sheet, when the tilemap itself is clicked on, it adds to the grass variable. I know that's causing the problem; I just don't know how to add another condition that triggers the event when only grass is clicked on, or only dirt is clicked on.
Basically, to sum it up, I'm looking for a way to have the game add to only the grass variable when I click on grass. Same with other blocks and their variables once I add them. I'm totally new to Construct 2, so I might not understand anything complex