functiononUse(cid, item, fromPosition, itemEx, toPosition)localpetName = "[PET] NIVEL MAXIMO"localrequiredStorage1 = 91811localrequiredStorage2 = 13546localstorageValue = 83712localplayerPets = getCreatureSummons(cid)-- Check if the player has the required immortality storagesifgetPlayerStorageValue(cid, requiredStorage1) == 1andgetPlayerStorageValue(cid, requiredStorage2) == 1then-- Check if the player already has a summoned petif #playerPets <= 0then-- If no pet is summoned, summon a new onelocalnewPet = doSummonMonster(cid, petName)ifnewPetthen
setPlayerStorageValue(cid, storageValue, 1)endelse-- If a pet is summoned, check if it's the correct one and remove itfor_, petinipairs(playerPets) doifgetCreatureName(pet) == petNamethen
doRemoveCreature(pet)endendendelse-- If the player doesn't have the required storages, send a message
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need the immortality storage to use this item.")endreturntrueend
Pergunta
Muvuka 1
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados