I want an item that if I consume it it will summon a monster (and remove the summoning item from my inventory).
I don't really know what to give you because I don't know what you will need so please help if you need something just ask.


[100] = { 	name = "Spawn Monster", 	desc = "You may only use it once.", 	r = 128, g = 0, b = 0, 	action = {"cast", "hold"}, 	slot = 9, 	fimage = "gfx/weiwen/rune.png", 	func = {function(id, itemslot, itemid, equip) 		local m = deepcopy(CONFIG.MONSTERS[math.random(#CONFIG.MONSTERS)]) -- Set your monster here, currently gets random 		m.x, m.y = math.floor(player(id,"x")*32+16), math.floor(player(id,"y")*32+16) -- Define your spawn x & y, currently uses player pos 		Monster:new(m) -- Execute the new monster spawn 		destroyitem(id, itemslot, equip) -- Destroy the item 	end, equip}, },
[100] = { 	name = "Spawn Monster", 	desc = "You may only use it once.", 	r = 128, g = 0, b = 0, 	action = {"cast", "hold"}, 	slot = 9, 	fimage = "gfx/weiwen/rune.png", 	func = {function(id, itemslot, itemid, equip) 		local m = deepcopy(CONFIG.MONSTERS[math.random(#CONFIG.MONSTERS)]) -- Set your monster here, currently gets random 		m.x, m.y = math.floor(player(id,"x")*32+16), math.floor(player(id,"y")*32+16) -- Define your spawn x & y, currently uses player pos 		Monster:new(m) -- Execute the new monster spawn 		destroyitem(id, itemslot, equip) -- Destroy the item 	end, equip}, },
m.x, m.y = math.floor(player(id,"x")*32+16), math.floor(player(id,"y")*32+16)
m.x, m.y = math.floor(player(id,"x")), math.floor(player(id,"y"))
local m = deepcopy(CONFIG.MONSTERS["Monster scary"])
[...]needs to be a number as there isn't such thing as
["Monster scary"] = {name, health, ...}in CONFIG.MONSTER.
{{},{},{}}
local m = deepcopy(CONFIG.MONSTERS[10])
if not gettile(player(id, "x"), player(id, "y")).SAFE and not gettile(player(id, "x"), player(id, "y")).NOMONSTERS then
player(id, "x")and
player(id, "y")may need to be changed to
tilexand
tiley- Not sure. Been a long time since I worked with Tibia zones.
if player(id,"health") > 0 and not gettile(player(id, 'tilex'), player(id, 'tiley')).SAFE and not gettile(player(id, "tilex"), player(id, "tiley")).NOMONSTERS then
function can_it_spawn(id) 	if player(id,"health") > 0 and not gettile(player(id, 'tilex'), player(id, 'tiley')).SAFE and not gettile(player(id, "tilex"), player(id, "tiley")).NOMONSTERS then 		return true 	else 		return false 	end end
[900] = { name = "Spawn Monster", desc = "You may only use it once.", r = 128, g = 0, b = 0, action = {"cast", "hold"}, slot = 9, fimage = "gfx/weiwen/rune.png", func = {function(id, itemslot, itemid, equip) 	if (gettile(PLAYERS[id].x, PLAYERS[id].y).SAFE or gettile(PLAYERS[id].x, PLAYERS[id].y).NOMONSTERS) then msg2(id,"\169255000000You can't spawn a monster in a monster-disabled zone!") return false end 	if inarray(CONFIG.WATERTILES, tile(player(id,"tilex"), player(id,"tiley"), 'frame')) then msg2(id,"\169255000000You can't spawn a monster in the water!") return false end 	if tile(player(id,"tilex"),player(id,"tiley"),"wall") then msg2(id,"\169255000000You can't spawn a monster in a wall!") return false end 	if player(id,"health") > 0 then 	local m = deepcopy(CONFIG.MONSTERS[math.random(#CONFIG.MONSTERS)]) 		m.x, m.y = math.floor(player(id,"x")), math.floor(player(id,"y")) 		Monster:new(m) 		destroyitem(id, itemslot, equip) 		return true 	end end, equip}, 	},
math.floor((self.x/32)+0.5),math.floor((self.y/32)+0.5)