local monsters = {"demon", "fury"}
function onTextEdit(cid, item, newText)
if item.uid == 15000 and item.itemid == 1811 then -- add the unique id in the blackboard
local t = {}
if(newText ~= '') then
t = string.explode(newText, ",")
end
local n = tonumber(t[2])
if(not n) then
n = 1
end
if isInArray(monsters, t[1]) then
if n <= 10 and n >= 1 then
for i = 1, n do
local pos = {x= math.random(94, 100), y= math.random(114, 120), z=7} -- edit here the locations from the area they spawn in
doSummonCreature(t[1], pos)
end
doPlayerSendTextMessage(cid, 25, n.." "..(n > 1 and ""..t[1].."s" or t[1]).." spawned.")
else
doPlayerSendTextMessage(cid, 22, "You can only choose between 1 and 10.")
end
else
local text = "Monsters you can choose"
for _, x in pairs(monsters) do
text = text .."\n"..x.. ""
end
doPlayerSendTextMessage(cid, 27, text.."\nExample: monstername, 2")
end
end
return true
end