Figure out what the grass tile is, then do
PHP Code:
if (player.level.tiles[x, y] == 9999) { // replace 9999 with the grass tile
To figure out what tile number grass has, do something simple like
PHP Code:
// press "t" to see what tile your mouse is hovering over
//#CLIENTSIDE
function onKeyPressed(temp.code, temp.key) {
if (temp.key == "t") {
player.chat = "Tile: " @ player.level.tiles[mousex, mousey];
}
}
If your server has multiple grass tiles (or you want it to be possible to dig on sand or something), make an array of tiles and use
in to see if the tile is in that array.