Postado Janeiro 3, 2015 10 anos Ids ? function onUse(cid, item, frompos, item2, topos) if item.uid == 60000 and getPlayerStorageValue(cid,60000) == -1 and getPlayerStorageValue(cid,60001) == -1 and getPlayerStorageValue(cid,60002) == -1 and getPlayerStorageValue(cid,60003) == -1 and getPlayerStorageValue(cid,60004) == -1 then doPlayerSendTextMessage(cid,25,"You have found a item.") doPlayerAddItem(cid,1987,1) setPlayerStorageValue(cid,60000,1) else doPlayerSendTextMessage(cid,25,"It is empty.") end end return true end function onUse(cid, item, frompos, item2, topos) if item.uid == 60001 and getPlayerStorageValue(cid,60000) == -1 and getPlayerStorageValue(cid,60001) == -1 and getPlayerStorageValue(cid,60002) == -1 and getPlayerStorageValue(cid,60003) == -1 and getPlayerStorageValue(cid,60004) == -1 then doPlayerSendTextMessage(cid,25,"You have found a item.") doPlayerAddItem(cid,1987,1) setPlayerStorageValue(cid,60001,1) else doPlayerSendTextMessage(cid,25,"It is empty.") end end return true end function onUse(cid, item, frompos, item2, topos) if item.uid == 60002 and getPlayerStorageValue(cid,60000) == -1 and getPlayerStorageValue(cid,60001) == -1 and getPlayerStorageValue(cid,60002) == -1 and getPlayerStorageValue(cid,60003) == -1 and getPlayerStorageValue(cid,60004) == -1 then doPlayerSendTextMessage(cid,25,"You have found a item.") doPlayerAddItem(cid,1987,1) setPlayerStorageValue(cid,60002,1) else doPlayerSendTextMessage(cid,25,"It is empty.") end end return true end function onUse(cid, item, frompos, item2, topos) if item.uid == 60003 and getPlayerStorageValue(cid,60000) == -1 and getPlayerStorageValue(cid,60001) == -1 and getPlayerStorageValue(cid,60002) == -1 and getPlayerStorageValue(cid,60003) == -1 and getPlayerStorageValue(cid,60004) == -1 then doPlayerSendTextMessage(cid,25,"You have found a item.") doPlayerAddItem(cid,1987,1) setPlayerStorageValue(cid,60003,1) else doPlayerSendTextMessage(cid,25,"It is empty.") end end return true end function onUse(cid, item, frompos, item2, topos) if item.uid == 60004 and getPlayerStorageValue(cid,60000) == -1 and getPlayerStorageValue(cid,60001) == -1 and getPlayerStorageValue(cid,60002) == -1 and getPlayerStorageValue(cid,60003) == -1 and getPlayerStorageValue(cid,60004) == -1 then doPlayerSendTextMessage(cid,25,"You have found a item.") doPlayerAddItem(cid,1987,1) setPlayerStorageValue(cid,60004,1) else doPlayerSendTextMessage(cid,25,"It is empty.") end end return true end <action uniqueid="60000;60001;60002;60003;60004" event="script" value="questcincoitems.lua"/> Vê se funciona. Não se esqueça de alterar o id em: doPlayerAddItem(cid,1987,1) Caso contrário, os três baús darão os mesmos items. para adicionar o crosbow e arrow no mesmo baú é só adicionar mais uma linha de doplayeradditem, em baixo da mesma... Editado Janeiro 3, 2015 10 anos por Caronte (veja o histórico de edições) Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: Mostrar conteúdo oculto [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Janeiro 3, 2015 10 anos Autor Nada, tem que ser também uma unica UNIQUEID, no caso 60002, essas outras eu uso em outras quest Editado Janeiro 3, 2015 10 anos por jNo (veja o histórico de edições) (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Janeiro 3, 2015 10 anos Ou você pode usar esse código: local items = { [actionid] = itemid, [actionid] = itemid, [actionid] = itemid, [actionid] = itemid, [actionid] = {itemid, itemid}, } local storage = 7601 function onUse(cid, item, frompos, item2, topos) if items[item.actionid] then if getPlayerStorageValue(cid, storage) < 1 then local _item = items[item.actionid] if type(_item) == "table" then for i = 1, #_item do doPlayerAddItem(cid, _item[i], 1) end else doPlayerAddItem(cid, _item, 1) end doPlayerSendTextMessage(cid, 27, "Hey, you found something!") setPlayerStorageValue(cid, storage, 1) else return doPlayerSendCancel(cid, "You already got your item.") end end return true end Cada baú, 1 actionid. Não se esqueça de configurar a tabela items. Na tag, você coloca as actionids (serão 5, no total). Se preferir, você pode optar pelo seguinte código: local items = { [{x = x, y = y, z = z}] = itemid, -- [{posição do baú}] = id do item, [{x = x, y = y, z = z}] = itemid, [{x = x, y = y, z = z}] = itemid, [{x = x, y = y, z = z}] = itemid, [{x = x, y = y, z = z}] = {itemid, itemid}, } local storage = 7601 function onUse(cid, item, frompos, item2, topos) if items[topos] then if getPlayerStorageValue(cid, storage) < 1 then local _item = items[topos] if type(_item) == "table" then for i = 1, #_item do doPlayerAddItem(cid, _item[i], 1) end else doPlayerAddItem(cid, _item, 1) end doPlayerSendTextMessage(cid, 27, "Hey, you found something!") setPlayerStorageValue(cid, storage, 1) else return doPlayerSendCancel(cid, "You already got your item.") end end return true end Dessa vez, é apenas 1 actionid para todos os baús. Eu indiquei no código como configurar a tabela items. Qualquer dúvida, só falar. agr que li que vc queria com uniqueid. mas enfim, se alguém quiser usar aid, tá aí ;s Editado Janeiro 3, 2015 10 anos por zipter98 (veja o histórico de edições) não respondo pms solicitando suporte em programação/scripting
Postado Janeiro 3, 2015 10 anos ?? Como assim nada ? Sò mudar para umas que você não tem. Já que você quer só um uniqueid: function onUse(cid, item, frompos, item2, topos) local i = {IDsorc, IDdruid, IDpala, IDkina} local msg = {"You found a item","It's empty"} if item.uid == 60000 and getPlayerStorageValue(cid,storage) == -1 then doPlayerAddItem(cid,i[getPlayerVocation(cid)],1) setPlayerStorageValue(cid,60000,1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,msg[1]) else doPlayerSendCancel(cid,msg[2]) end return true end Editado Janeiro 3, 2015 10 anos por Caronte (veja o histórico de edições) Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: Mostrar conteúdo oculto [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Janeiro 3, 2015 10 anos Autor @Zipter98 deu esse erro no 1 script, no 2 nem pegou. @Carionte, no seu 1 script deu esse erro, também optarei por usar uniquesid diferente vai facilitar por aqui deu erro no distro de duplicate ID Estou usando assim o Action, coloquei uniqueid por uniqueid já nos bau. <action uniqueid="60002;60003;60004;60005;60006" event="script" value="questvipacess/bauweapons.lua"/> (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
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.