English Tile Damage.

6 replies
Goto Page
To the start Previous 1 Next To the start
05.08.11 03:35:02 pm
Up
iCe4147
User
Offline Off
Hey Guys,

I need help. When a player moves over a certain tile frame.. lets say frame 111 or something.. Can anyone post a script or make one for me that when a player moves over a tile he gets damaged for every second he stays on it?
I am so old school with this game
05.08.11 03:42:55 pm
Up
DannyDeth
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
tile_x = 32
tile_y 785
addhook("second","check_tile")
function check_tile()
     for i=1,32 do
          if( player(i,"exists")) then
               if(player(i,"tilex")=tile_x and player(i,"tiley")=tile_y) then
                    parse("slap "..i)
               end
          end
     end
end

However, you cannot use mutliple tiles with this script. Someone else can improve it, if they like. Imma go continue my garden work.
05.08.11 04:15:08 pm
Up
RAVENOUS
BANNED
Offline Off
you can't use a certain frame, but you can use the material of it, like wood, tile, stone, deadly, water etc.

Just try using this as reference:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
TileMaterial = {
     [0] = "Floor: Soundless",
     [1] = "Wall",
     [2] = "Obstacle",
     [3] = "Wall / No Shadow",
     [4] = "Obstacle / No Shadow",
     [10] = "Floor: Dirt",
     [11] = "Floor: Snow",
     [12] = "Floor: Step",
     [13] = "Floor: Tile",
     [14] = "Floor: Water",
     [15] = "Floor: Metal",
     [16] = "Floor: Wood",
     [50] = "Deadly: Normal",
     [51] = "Deadly: Explosion",
     [52] = "Deadly: Toxic",
     [53] = "Deadly: Abyss"
     }

addhook("movetile","MoveTileHook")
function MoveTileHook(ID,X,Y)
     parse('hudtxt2 '..ID..' 2 "©102255102TILE: '..TileMaterial[tile(X,Y,"property")]..'" 320 220 1')
end

More >
"A work of art is the unique result of a unique temperament." - Oscar Wilde
05.08.11 07:21:42 pm
Up
Infinite Rain
Reviewer
Offline Off
Code:
1
2
3
function on_tile(tile, id)
     return tile(player(id, 'tilex'), player(id, 'tiley'), 'frame') == tile
end


use this code to check a frame u are standing on

like u said 111

Code:
1
2
3
if on_tile(id, 111) then
 msg('You on tile 111 WE ALL GONNA DIEE!!')
end


Use it

Edit: Ahh forgot about every second damage

Code:
1
2
3
4
5
6
7
8
addhook('second', 'sec')
function sec()
 for id = 1, 32 do
  if on_tile(111, id) then
   parse('slap '.. id)
  end
 end
end
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
07.08.11 02:26:39 pm
Up
sCy
User
Offline Off
Or just use env_hurt.

Easy and fast way.
Memento mori.
07.08.11 10:19:10 pm
Up
Apache uwu
User
Offline Off
I'm pretty sure he wants it dynamically that's why it's in the scripts section.

You could go for an easy script like this...


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
tile_hurt[0]=1
tile_hurt[43]=100

addhook("movetile","_movetile")
addhook("second","_second")

function _movetile(id,x,y)
     if tile_hurt[tile(x,y,"frame")]~=nil then
          parse("sethealth "..id.." "..player(id, "health")-tile_hurt[tile(x,y,"frame")])
     end
end

function _second()
     for _,id in player(0,"tableliving") do
          if tile_hurt[tile(player(id,"tilex"),player(id,"tiley")]~=nil then
          parse("sethealth "..id.." "..player(id, "health")-tile_hurt[tile(player(id,"tilex"),player(id,"tiley"),"frame")])
          end
     end
end


What are you making?
13.08.11 03:53:46 pm
Up
iCe4147
User
Offline Off
@Textual Context

Its a Tibia Script Lol. cZ Clan

Thank you guys for helping me out !!
I am so old school with this game
To the start Previous 1 Next To the start