I try to get the wire spawn back (and get the health of 100%) when pressing the use button next to it.
Problem is that it doesnt do it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function nz_use(id, event, data, x, y) 	if (player(id, "team") == 2) then 		if (event == 100) then 			-- repairing barbed wire 			if (entity(x, y, "trigger") == "barbedwire") then 				for _, v in ipairs(object(0, "table")) do 					if (object(v, "tilex") == x and object(v, "tiley") == y) then 						parse("killbuildings "..v) 						parse("spawnobject 2 "..x.." "..y.." 0 0 "..player(id,"team").." 0") 					end 				end 				 			end 		end 	end end
Any idea what is the problem?