Creation/Dev/Script/Functions/tiletype: Difference between revisions

From Graal Bible
 
No edit summary
 
Line 5: Line 5:
<br>
<br>
''example:''<pre>
''example:''<pre>
function onWeaponFired()
function onWeaponFired() {
{
   if (tiletype(player.x + 1.5, player.y + 2) == 3) {
   if ( tiletype(player.x + 1.5, player.y + 2) == 3 )
     player.chat = "I'm sitting!"
  {
     player.chat = "I'm Sitting!"
   }
   }
}
}

Latest revision as of 14:43, 2 April 2011

Syntax: tiletype( float x, float y );

Description

Is used for checking what type of tile the player or a npc is on.


example:

function onWeaponFired() {
  if (tiletype(player.x + 1.5, player.y + 2) == 3) {
    player.chat = "I'm sitting!"
  }
}

Checks if the player is on tiletype 3 (sit tile).

Tiletypes (can be use with setshape2)

Value Description
0 nonblock
2 hurt underground
3 chair
4 bed upper
5 bed lower
6 swamp
7 lava swamp
8 near water
11 water
12 lava
20 throw-through
21 jump stone
22 blocking