function onUse(cid, item, fromPosition, itemEx, toPosition) local petName = "[PET] NIVEL MAXIMO" local requiredStorage1 = 91811 local requiredStorage2 = 13546 local storageValue = 83712 local playerPets = getCreatureSummons(cid) -- Verificar se o jogador possui as storages necessárias if getPlayerStorageValue(cid, requiredStorage1) == 1 and getPlayerStorageValue(cid, requiredStorage2) == 1 then -- Verificar se o jogador já possui um pet invocado if #playerPets <= 0 then -- Se nenhum pet estiver invocado, invocar um novo local newPet = doSummonMonster(cid, petName) if newPet then setPlayerStorageValue(cid, storageValue, 1) end else -- Se um pet estiver invocado, verificar se é o pet correto e removê-lo for _, pet in ipairs(playerPets) do if getCreatureName(pet) == petName then doRemoveCreature(pet) end end end else -- Se o jogador não possuir as storages necessárias, enviar uma mensagem de erro doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need both immortality storages to use this item.") end return true end


info
Grupo: Artesão
Registrado: 01/03/20
Posts: 110
Reputação: +1
Gênero: Masculino
Char no Tibia: Samuel on Issobra