i want a script
that script is when i kill a NPC then appear items such as gold , money , other things
can someone give me that code??
Thank you
addhook("objectkill","spwnitm") function spwnitm(oid,pid) 	if object(oid,"type") == 30 then 		local a = math.random(1,8) 		local xx = object(oid,"tilex") 		local xx2 = xx - 1 		local xx3 = xx + 1 		local yy = object(oid,"tiley") 		local yy2 = yy + 1 		local yy3 = yy - 1 		if a == 1 then parse("spawnitem 68 "..xx2.." "..yy) 		elseif a == 2 then parse("spawnitem 68 "..xx3.." "..yy) 		elseif a == 3 then parse("spawnitem 68 "..xx.." "..yy2) 		elseif a == 4 then parse("spawnitem 68 "..xx.." "..yy3) 		elseif a == 5 then parse("spawnitem 68 "..xx2.." "..yy2) 		elseif a == 6 then parse("spawnitem 68 "..xx2.." "..yy3) 		elseif a == 7 then parse("spawnitem 68 "..xx3.." "..yy2) 		elseif a == 8 then parse("spawnitem 68 "..xx3.." "..yy3) 		end 	end end
addhook("objectkill","spwnitm") function spwnitm(oid,pid) 	if object(oid,"type") == 30 then 		local a = math.random(1,8) 		local xx = object(oid,"tilex") 		local xx2 = xx - 1 		local xx3 = xx + 1 		local yy = object(oid,"tiley") 		local yy2 = yy + 1 		local yy3 = yy - 1 		if a == 1 then parse("spawnitem 68 "..xx2.." "..yy) 		elseif a == 2 then parse("spawnitem 68 "..xx3.." "..yy) 		elseif a == 3 then parse("spawnitem 68 "..xx.." "..yy2) 		elseif a == 4 then parse("spawnitem 68 "..xx.." "..yy3) 		elseif a == 5 then parse("spawnitem 68 "..xx2.." "..yy2) 		elseif a == 6 then parse("spawnitem 68 "..xx2.." "..yy3) 		elseif a == 7 then parse("spawnitem 68 "..xx3.." "..yy2) 		elseif a == 8 then parse("spawnitem 68 "..xx3.." "..yy3) 		end 	end end
addhook("objectkill","spwnitm") function spwnitm(oid,pid) 	if object(oid,"type") == 30 then 		local a = math.random(1,8) 		local xx = object(oid,"tilex") 		local xx2 = xx - 1 		local xx3 = xx + 1 		local yy = object(oid,"tiley") 		local yy2 = yy + 1 		local yy3 = yy - 1 		if a == 1 then 			for b = 1, 3 do parse("spawnitem 68 "..xx2.." "..yy) end 		elseif a == 2 then 			for c = 1, 3 do parse("spawnitem 68 "..xx3.." "..yy) end 		elseif a == 3 then 			for d = 1, 3 do parse("spawnitem 68 "..xx.." "..yy2) end 		elseif a == 4 then 			for e = 1, 3 do parse("spawnitem 68 "..xx.." "..yy3) end 		elseif a == 5 then 			for f = 1, 3 do parse("spawnitem 68 "..xx2.." "..yy2) end 		elseif a == 6 then 			for g = 1, 3 do parse("spawnitem 68 "..xx2.." "..yy3) end 		elseif a == 7 then 			for h = 1, 3 do parse("spawnitem 68 "..xx3.." "..yy2) end 		elseif a == 8 then 			for i = 1, 3 do parse("spawnitem 68 "..xx3.." "..yy3) end 		end 	end end
addhook("objectkill","_objkill") function _objkill(b,id) if object(b,"type")==30 then parse('spawnitem '..math.random(1,88)..' '..object(b,"tilex")..' '..object(b,"tiley")) end end addhook("objectkill","_objkilll") function _objkilll(b,id) if object(b,"type")==30 then parse("setscore "..id.." "..(player(id,"score")+1)) end end
npc_items={64,65,66,67} addhook("objectkill","_objkill") function _objkill(b,id) if object(b,"type")==30 then local itm=npc_items[math.random(1,#npc_items)] parse('spawnitem '..itm..' '..object(b,"tilex")..' '..object(b,"tiley")) end end addhook("objectkill","_objkilll") function _objkilll(b,id) if object(b,"type")==30 then parse("setscore "..id.." "..(player(id,"score")+1)) end end