Postado Maio 4, 2015 10 anos Optei por deixar a essência do código do autor, não alterando sua funcionalidade original. Se o Lykkan quiser, posso adicionar esta função de remover a criatura alvo.
Postado Maio 5, 2015 10 anos Autor local monster, storage = "donkey", 5918 function onUse(cid, item, frompos, itemEx, topos) if getPlayerStorageValue(cid, storage) > -1 then return doPlayerSendTextMessage(cid, 19, "Sorry, you already have that ride.") elseif not isMonster(itemEx.uid) then return doPlayerSendCancel(cid, "Use this in a monster.") elseif getCreatureName(itemEx.uid):lower() ~= monster then return doPlayerSendCancel(cid, "Use this in "..monster..".") end doPlayerAddMount(cid, 13) doPlayerSendTextMessage(cid, 19, "The strange wheel seems to vibrate and slowly starts turning continuosly.") doRemoveItem(item.uid, 1) setPlayerStorageValue(cid, storage, 1) return true end Seria bom se remove-se a criatura e como eu faço pra colocar em outras montarias é só mudar o ID do item que vai remover e o nome da criatura?
Postado Maio 5, 2015 10 anos local mounts = { --[itemid] = {name = "monster", storage = storage, mountId = xxx}, [13937] = {name = "donkey", storage = 5918, mountId = 13}, } function onUse(cid, item, frompos, itemEx, topos) local target = mounts[item.itemid] if target then if getPlayerStorageValue(cid, target.storage) > -1 then return doPlayerSendTextMessage(cid, 19, "Sorry, you already have that ride.") elseif not isMonster(itemEx.uid) then return doPlayerSendCancel(cid, "Use this in a monster.") elseif getCreatureName(itemEx.uid):lower() ~= target.name then return doPlayerSendCancel(cid, "Use this in "..target.name..".") end doPlayerAddMount(cid, target.mountId) doRemoveCreature(itemEx.uid) doPlayerSendTextMessage(cid, 19, "The strange wheel seems to vibrate and slowly starts turning continuosly.") doRemoveItem(item.uid, 1) setPlayerStorageValue(cid, target.mountId, 1) end return true end
Postado Maio 5, 2015 10 anos Autor local mounts = { --[itemid] = {name = "monster", storage = storage, mountId = xxx}, [13937] = {name = "donkey", storage = 5918, mountId = 13}, } function onUse(cid, item, frompos, itemEx, topos) local target = mounts[item.itemid] if target then if getPlayerStorageValue(cid, target.storage) > -1 then return doPlayerSendTextMessage(cid, 19, "Sorry, you already have that ride.") elseif not isMonster(itemEx.uid) then return doPlayerSendCancel(cid, "Use this in a monster.") elseif getCreatureName(itemEx.uid):lower() ~= target.name then return doPlayerSendCancel(cid, "Use this in "..target.name..".") end doPlayerAddMount(cid, target.mountId) doRemoveCreature(itemEx.uid) doPlayerSendTextMessage(cid, 19, "The strange wheel seems to vibrate and slowly starts turning continuosly.") doRemoveItem(item.uid, 1) setPlayerStorageValue(cid, target.mountId, 1) end return true end Não da erro e nem funciona xD não aparece nada =(
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.