Postado Fevereiro 10, 2017 8 anos Quando eu uso o item aparece esse erro no console: Citar Attempt to call global 'doPlayerSetStorageValue' <a nil value> stack traceback: [C]: in function 'doPlayerSetStorageValue' Eu uso este script local a = { itemid = 26194, -- ID DO ITEM QUE VAI DAR A MOUNT mountID = 94, -- ID DA MOUNT storage = 64656, -- STORAGE, SÓ ALTERE SE NECESSARIO } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, a.storage) == -1 then if getPlayerItemCount(cid, a.itemid) >= 1 then doPlayerAddMount(cid, a.mountID) doPlayerRemoveItem(cid, a.itemid, 1) doCreatureSay(cid, 'You receive the permission to ride a sparkion', TALKTYPE_MONSTER_SAY, 2, 2) doPlayerSetStorageValue(cid, a.storage, 1) else doPlayerSendCancel(cid, "You must have the item in the backpack in order to purchase your mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end else doPlayerSendCancel(cid, "Sorry, you already have this mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end Eu queria esse script adicionasse a storage impedindo de ele usar o item de montaria novamente. TFS 1.2 Desde já agradeço
Postado Fevereiro 11, 2017 8 anos Nunca trabalhei com TFS 1.2 mas tente mudar o "doPlayerSetStorageValue" para "setPlayerStorageValue" Te ajudei? Clique em Gostei ! ²²²d¬¬b²²² "She's got a smile that it seems to me...." ♪♪
Postado Fevereiro 11, 2017 8 anos Em 10/02/2017 ás 13:44, FlavioHulk disse: Quando eu uso o item aparece esse erro no console: Eu uso este script local a = { itemid = 26194, -- ID DO ITEM QUE VAI DAR A MOUNT mountID = 94, -- ID DA MOUNT storage = 64656, -- STORAGE, SÓ ALTERE SE NECESSARIO } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, a.storage) == -1 then if getPlayerItemCount(cid, a.itemid) >= 1 then doPlayerAddMount(cid, a.mountID) doPlayerRemoveItem(cid, a.itemid, 1) doCreatureSay(cid, 'You receive the permission to ride a sparkion', TALKTYPE_MONSTER_SAY, 2, 2) doPlayerSetStorageValue(cid, a.storage, 1) else doPlayerSendCancel(cid, "You must have the item in the backpack in order to purchase your mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end else doPlayerSendCancel(cid, "Sorry, you already have this mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end Eu queria esse script adicionasse a storage impedindo de ele usar o item de montaria novamente. TFS 1.2 Desde já agradeço local a = { itemid = 26194, -- ID DO ITEM QUE VAI DAR A MOUNT mountID = 94, -- ID DA MOUNT storage = 64656, -- STORAGE, SÓ ALTERE SE NECESSARIO } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, a.storage) == -1 then if getPlayerItemCount(cid, a.itemid) >= 1 then doPlayerAddMount(cid, a.mountID) doPlayerRemoveItem(cid, a.itemid, 1) doCreatureSay(cid, 'You receive the permission to ride a sparkion', TALKTYPE_MONSTER_SAY, 2, 2) setPlayerStorageValue(cid, a.storage, 1) else doPlayerSendCancel(cid, "You must have the item in the backpack in order to purchase your mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end else doPlayerSendCancel(cid, "Sorry, you already have this mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end
Postado Fevereiro 12, 2017 8 anos Solução local a = { mountID = 94, -- ID DA MOUNT storage = 64656, -- STORAGE, SÓ ALTERE SE NECESSARIO } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(a.storage) == -1 then if player:getItemCount(a.itemid) >= 1 then player:addMount(a.mountID) Item(item.itemid):remove(1) player:say("You receive the permission to ride a sparkion", TALKTYPE_MONSTER_SAY) player:setStorageValue(a.storage, 1) else player:sendCancelMessage("You must have the item in the backpack in order to purchase your mount.") player:getPosition():sendMagicEffect(2) end else player:sendCancelMessage("Sorry, you already have this mount.") player:getPosition():sendMagicEffect(2) end return TRUE end
Postado Fevereiro 12, 2017 8 anos Autor Em 11/02/2017 ás 07:54, luangop disse: Nunca trabalhei com TFS 1.2 mas tente mudar o "doPlayerSetStorageValue" para "setPlayerStorageValue" Valeu pela força, @luangop! Mas o script tinha que ser atualizado mesmo... Mas valeu pela tentativa 19 horas atrás, Gustavo Ntos disse: local a = { itemid = 26194, -- ID DO ITEM QUE VAI DAR A MOUNT mountID = 94, -- ID DA MOUNT storage = 64656, -- STORAGE, SÓ ALTERE SE NECESSARIO } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, a.storage) == -1 then if getPlayerItemCount(cid, a.itemid) >= 1 then doPlayerAddMount(cid, a.mountID) doPlayerRemoveItem(cid, a.itemid, 1) doCreatureSay(cid, 'You receive the permission to ride a sparkion', TALKTYPE_MONSTER_SAY, 2, 2) setPlayerStorageValue(cid, a.storage, 1) else doPlayerSendCancel(cid, "You must have the item in the backpack in order to purchase your mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end else doPlayerSendCancel(cid, "Sorry, you already have this mount.") doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end Eu tinha tentado fazer isso, mas também dava erro :S, mas valeu pela força!!!!! @Gustavo Ntos 12 horas atrás, KotZletY disse: local a = { mountID = 94, -- ID DA MOUNT storage = 64656, -- STORAGE, SÓ ALTERE SE NECESSARIO } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(a.storage) == -1 then if player:getItemCount(a.itemid) >= 1 then player:addMount(a.mountID) Item(item.uid):remove(1) player:say("You receive the permission to ride a sparkion", TALKTYPE_MONSTER_SAY) player:setStorageValue(a.storage, 1) else player:sendCancelMessage("You must have the item in the backpack in order to purchase your mount.") player:getPosition():sendMagicEffect(2) end else player:sendCancelMessage("Sorry, you already have this mount.") player:getPosition():sendMagicEffect(2) end return TRUE end Pô mano, valeu muito! Realmente funcionou, só ficou faltando o item id no local a nas primeiras linhas, mas corrigi isso! @KotZletY, e já te pergunto se posso postar diretamente no tópico de script?!
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.