who can fix this script when a player have item 2345 he can summon this pet but dont remove the item
rep++
PHP:
local d,l,g,m,s = 'pet one'
function onSay(cid,words,param)
local v = getThingPos(cid)
if getPlayerStorageValue(cid,s) ~= 1 then
if not getTilePzInfo(v) then
if getPlayerLevel(cid) >= l then
if item.itemid == 2345 then
setPlayerStorageValue(cid,s,1)
doSummonMonster(cid,d:lower())
doSendMagicEffect(v,12)
doPlayerSendTextMessage(cid,27,'You summoned a '..d..'.')
else
doPlayerSendCancel(cid,'Not enough gold, need '..g..' gold.')
doSendMagicEffect(v,2)
end
else
local n = l - getPlayerLevel(cid)
doPlayerSendCancel(cid,'You need '..n..' levels more to summon this.')
doSendMagicEffect(v,2)
end
else
doPlayerSendCancel(cid,'Not allowed in PZ.')
doSendMagicEffect(v,2)
end
else
for _,c in ipairs(getCreatureSummons(cid)) do
doSendMagicEffect(getThingPos(c),2)
doRemoveCreature(c)
end
setPlayerStorageValue(cid,s,0)
doPlayerSendTextMessage(cid,27,d..' is called back.')
end
return true
end
rep++