View Single Post
  #3  
Old 05-29-2011, 07:36 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Figure out what the grass tile is, then do

PHP Code:
if (player.level.tiles[xy] == 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.codetemp.key) {
  if (
temp.key == "t") {
    
player.chat "Tile: " player.level.tiles[mousexmousey];
  }

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.
__________________
Reply With Quote