could some one add execution to this script then the player can use it every 30 seconds .
Code:
local config = {
monsters = {
['Demon'] = {}
}
}
function onUse(cid, item, fromPosition, itemEx, topos)
local summons = getCreatureSummons(cid)
for _, summoned in ipairs(summons) do
if config.monsters[getCreatureName(summoned)] then
doSendMagicEffect(getPlayerPosition(cid), 12)
doRemoveCreature(summoned)
doPlayerSendTextMessage(cid,27,'You have backed your monster')
return true
end
end
if(getTilePzInfo(getCreaturePosition(cid)) == true) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't summon in pz.")
return true
end
if table.maxn(getCreatureSummons(cid)) <= 0 then -- ?ndra till max antalet summons
doSummonMonster(cid, 'Demon')
doSendMagicEffect(getPlayerPosition(cid), 28)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You already have a summon.")
end
return true
end
Last edited: