1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
### Rock
id=63
name=Rock
group=stone
icon=gfx\rock01.bmp
model=gfx\rock01.b3d
scale=4
detailtex=1
mat=stone
health=200
find=22,5,1
find=21,90,7
find=23,300,1,1,88
var=hit,Hits,50,0
script=start
on:hit {
		if (getplayerweapon()==30){
			$hit--;
			if ($hit==0){
				alterobject "self",74;
			}
		}
}
script=end
if you put a
var in the ID as above,
(var=hit,Hits,50,0),you can use on:hit to change the object after 50 hits. Instead of on:kill.
above on:hit checks to see if the player has a hammer ID30, then it subtracts hits from the var 50 until it reaches 0 then alters the object to object ID74.
you can check to see any other type weapon being held by the player and change the
if ($hit==0) to coincide with that weapons damage, like if he has a pickaxe then maybe the rock would change in 30 hits instead of 50, so you would make it
if ($hit==20) for that additional statement.
1
2
3
4
5
6
7
8
9
10
11
12
13
on:hit {
	 if (getplayerweapon()==30){
			$hit--;
			if ($hit==0){
				alterobject "self",74;
			}
}elseif (getplayerweapon()==99){
			$hit--;
			if ($hit==20){
				alterobject "self",74;
			}
}
}