Postado Abril 26, 2019 6 anos @victor4312 local config = { name = "Demon", -- Nome do Summon storage = 42355, -- Storage que permite o uso exaust_sto = 5555, -- Storage que contabiliza o exaust exaust_time = 60 -- Segundos de Exaust } function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, config.storage) == 1 then if not exhaustion.check(cid, config.exaust_sto) then local target = doCreateMonster(config.name, pos) doConvinceCreature(cid, target) doSendMagicEffect(pos, CONST_ME_TELEPORT) exhaustion.set(cid, config.exaust_sto, config.exaust_time) return true else doPlayerSendTextMessage(cid, 27, "Exhaustion!! Wait ".. exhaustion.get(cid, config.exaust_sto) .." seconds.") doSendMagicEffect(pos, POFF) return false end else doPlayerSendTextMessage(cid, 27, "voce nao tem a storage necessaria") doSendMagicEffect(pos, POFF) return false end return true end
Postado Abril 26, 2019 6 anos Autor @Storm Tem como colocar um limite pra apenas um Summon por vez e retirar a parte que o item some após o uso?
Postado Abril 26, 2019 6 anos @victor4312 local config = { name = "Demon", -- Nome do Summon max = 1, -- Máximo de summons storage = 42355, -- Storage que permite o uso exaust_sto = 5555, -- Storage que contabiliza o exaust exaust_time = 60 -- Segundos de Exaust } function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, config.storage) == 1 then if not exhaustion.check(cid, config.exaust_sto) then if table.maxn(getCreatureSummons(cid)) <= config.max then local target = doCreateMonster(config.name, pos) doConvinceCreature(cid, target) doPlayerSendTextMessage(cid, 27, "Voce invocou o monstro ".. config.name .."!!") doSendMagicEffect(pos, CONST_ME_TELEPORT) exhaustion.set(cid, config.exaust_sto, config.exaust_time) return true else doPlayerSendTextMessage(cid, 27, "Você ja tem a quantidade máxima de summons ativos!") doSendMagicEffect(pos, POFF) return false end else doPlayerSendTextMessage(cid, 27, "Exhaustion!! Wait ".. exhaustion.get(cid, config.exaust_sto) .." seconds.") doSendMagicEffect(pos, POFF) return false end else doPlayerSendTextMessage(cid, 27, "voce nao tem a storage necessaria") doSendMagicEffect(pos, POFF) return false end return true end @CaioPinaa local monster = "Demon" -- Monster name local max = 1 -- Max de summons ativos function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getCreaturePosition(cid) if table.maxn(getCreatureSummons(cid)) < max then local target = doCreateMonster(monster, pos) doConvinceCreature(cid, target) doSendMagicEffect(pos, 5) else doPlayerSendTextMessage(cid, 27, "Você ja tem a quantidade máxima de summons ativos!") doSendMagicEffect(pos, POFF) return false end return true end
Postado Abril 26, 2019 6 anos @victor4312 Substitui na script; doPlayerSendTextMessage(cid, 27, "Espere ".. math.floor(exhaustion.get(cid, config.exaust_sto) / 60) .." minuto(s) e ".. exhaustion.get(cid, config.exaust_sto) - (math.floor(exhaustion.get(cid, config.exaust_sto) / 60)*60) .." segundo(s) para usar seu pet novamente.")
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.