Forum

> > CS2D > Scripts > Tile Damage.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Tile Damage.

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Tile Damage.

iCe4147
User Off Offline

Zitieren
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?

alt Re: Tile Damage.

DannyDeth
User Off Offline

Zitieren
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.

alt Re: Tile Damage.

RAVENOUS
BANNED Off Offline

Zitieren
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:

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
Mehr >

alt Re: Tile Damage.

Infinite Rain
Reviewer Off Offline

Zitieren
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

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

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

alt Re: Tile Damage.

Apache uwu
User Off Offline

Zitieren
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...


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?

alt Re: Tile Damage.

iCe4147
User Off Offline

Zitieren
@Textual Context

Its a Tibia Script Lol. cZ Clan

Thank you guys for helping me out !!
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht