mikkas70 0 Postado Fevereiro 10, 2012 Share Postado Fevereiro 10, 2012 Eu gostaria de saber se alguem podia fazer com que a exp scroll só pudesse ser usada a partir de level 200 Aqui está a script: -- [( Script created by Doidin for XTibia.com )] -- local exp = 10000 -- Quanto de experience o player irá ganhar?! local exhaust = 60 -- Tempo para o player poder usar o item novamente! (tempo em segundos) local text = "Congratulations, you gained "..exp.." points of experience." local storage = 9811 -- Não mexa aqui. function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerStorageValue(cid, storage) <= os.time()) then doPlayerAddExp(cid, exp) doCreatureSay(cid, text, 19) doSendMagicEffect(getCreaturePosition(cid), 14) doRemoveItem(cid, item.uid, 1) setPlayerStorageValue(cid, storage, os.time()+exhaust) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end return TRUE end Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/ Compartilhar em outros sites More sharing options...
0 AnneMotta 234 Postado Fevereiro 10, 2012 Share Postado Fevereiro 10, 2012 testa este a qui : -- [( Script created by Doidin for XTibia.com )] -- local exp = 10000 -- Quanto de experience o player irá ganhar?! local exhaust = 60 -- Tempo para o player poder usar o item novamente! (tempo em segundos) local text = "Congratulations, you gained "..exp.." points of experience." local storage = 9811 -- Não mexa aqui. local level = 200 -- Level que podera usar o exp scroll. local msg = "Sorry, You need to be level 200+" -- Msg se não tiver level 200. function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) >= level then if (getPlayerStorageValue(cid, storage) <= os.time()) then doPlayerAddExp(cid, exp) doCreatureSay(cid, text, 19) doSendMagicEffect(getCreaturePosition(cid), 14) doRemoveItem(cid, item.uid, 1) setPlayerStorageValue(cid, storage, os.time()+exhaust) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, msg) end return TRUE end Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199732 Compartilhar em outros sites More sharing options...
0 mikkas70 0 Postado Fevereiro 10, 2012 Autor Share Postado Fevereiro 10, 2012 testa este a qui : -- [( Script created by Doidin for XTibia.com )] -- local exp = 10000 -- Quanto de experience o player irá ganhar?! local exhaust = 60 -- Tempo para o player poder usar o item novamente! (tempo em segundos) local text = "Congratulations, you gained "..exp.." points of experience." local storage = 9811 -- Não mexa aqui. local level = 200 -- Level que podera usar o exp scroll. local msg = "Sorry, You need to be level 200+" -- Msg se não tiver level 200. function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) >= level then if (getPlayerStorageValue(cid, storage) <= os.time()) then doPlayerAddExp(cid, exp) doCreatureSay(cid, text, 19) doSendMagicEffect(getCreaturePosition(cid), 14) doRemoveItem(cid, item.uid, 1) setPlayerStorageValue(cid, storage, os.time()+exhaust) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, msg) end return TRUE end A scroll agora nem está fazendo nada... Caso você dá use nela, simplesmente abre como se fosse para escrever... (tentei com level menor que 200 e maior que 200 ambos como mesmo efeito) Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199754 Compartilhar em outros sites More sharing options...
0 AnneMotta 234 Postado Fevereiro 10, 2012 Share Postado Fevereiro 10, 2012 Tenta assim, eu testei aque e pegou: local exp = 10000 -- Quanto de experience o player irá ganhar?! local exhaust = 60 -- Tempo para o player poder usar o item novamente! (tempo em segundos) local storage = 87544 -- Não mexa aqui. local level = 200 -- Level que podera usar o exp scroll. function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) >= level then if (getPlayerStorageValue(cid, storage) <= os.time()) then doPlayerAddExp(cid, exp) doCreatureSay(cid, "Congratulations, you gained "..exp.." points of experience.", 19) doSendMagicEffect(getCreaturePosition(cid), 14) doRemoveItem(cid, item.uid, 1) setPlayerStorageValue(cid, storage, os.time()+exhaust) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Sorry,You need to be level "..level.." or more for use this item.") end return TRUE end Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199773 Compartilhar em outros sites More sharing options...
0 Vodkart 1515 Postado Fevereiro 10, 2012 Share Postado Fevereiro 10, 2012 testa este a qui : -- [( Script created by Doidin for XTibia.com )] -- local exp = 10000 -- Quanto de experience o player irá ganhar?! local exhaust = 60 -- Tempo para o player poder usar o item novamente! (tempo em segundos) local text = "Congratulations, you gained "..exp.." points of experience." local storage = 9811 -- Não mexa aqui. local level = 200 -- Level que podera usar o exp scroll. local msg = "Sorry, You need to be level 200+" -- Msg se não tiver level 200. function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) >= level then if (getPlayerStorageValue(cid, storage) <= os.time()) then doPlayerAddExp(cid, exp) doCreatureSay(cid, text, 19) doSendMagicEffect(getCreaturePosition(cid), 14) doRemoveItem(cid, item.uid, 1) setPlayerStorageValue(cid, storage, os.time()+exhaust) else doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") end else doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, msg) end return TRUE end A scroll agora nem está fazendo nada... Caso você dá use nela, simplesmente abre como se fosse para escrever... (tentei com level menor que 200 e maior que 200 ambos como mesmo efeito) Então quem está fazendo algo de errado é você,pois o script em si não possui erros...veja se o id do item em actions.xml está certo Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199777 Compartilhar em outros sites More sharing options...
0 mikkas70 0 Postado Fevereiro 11, 2012 Autor Share Postado Fevereiro 11, 2012 Deu certinho agora! Esse topico pode ser encerrado! Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199885 Compartilhar em outros sites More sharing options...
0 AnneMotta 234 Postado Fevereiro 11, 2012 Share Postado Fevereiro 11, 2012 Mereço 1 rep ? SKSOASAOKSAOKSAOK' Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199895 Compartilhar em outros sites More sharing options...
0 Lordfire 309 Postado Fevereiro 11, 2012 Share Postado Fevereiro 11, 2012 Merece. Movido. Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199910 Compartilhar em outros sites More sharing options...
0 mikkas70 0 Postado Fevereiro 11, 2012 Autor Share Postado Fevereiro 11, 2012 Eu penso que já dei um pra você hoje ;b Para além disso cheguei ao máximo de rep que posso dar por hoje Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1199912 Compartilhar em outros sites More sharing options...
0 testepaulinho 0 Postado Novembro 10, 2012 Share Postado Novembro 10, 2012 eu tambeém tenho uma duvida !! queria colocar um efeito ao usar o scrol tem como tem como alguem fazer pra mim, tipo um efeito area ! CODIGOO local config = { funnyEffect = "NO", minimumLevel = 50, maximumLevel = 99999, -- for infinite type math.huge } local addExp = { [{config.minimumLevel, 100}] = 2500000, [{100, 200}] = 5000000, [{200, 300}] = 7500000, [{300, 400}] = 15000000, [{400, 500}] = 20000000, [{500, 600}] = 30000000, [{600, 1000}] = 40000000, [{1000, 2000}] = 50000000, [{2000, 2500}] = 155000000, [{2500, 7500}] = 300000000, [{7500, 10000}] = 350000000, [{10000, 20000}] = 400000000, [{20000, config.maximumLevel}] = 450000000 } function onUse(cid, item, fromPosition, itemEx, toPosition) local level = getPlayerLevel(cid) local effect = math.random(CONST_ME_FIREWORK_YELLOW,CONST_ME_FIREWORK_BLUE) if level < config.minimumLevel then doPlayerSendCancel(cid, "You need to be at least "..config.minimumLevel.." to use a scroll.") return FALSE end if level >= config.maximumLevel then doPlayerSendCancel(cid, "Your level is too high for using a scroll.") return FALSE end for k, v in pairs(addExp) do if level >= k[1] and level < k[2] then doPlayerAddExp(cid, v) doPlayerSendTextMessage(cid, 22, "Experience Scroll Gave You " .. v .." experience!") doRemoveItem(item.uid, 1) break end end if config.funnyEffect == "YES" then local playerexp = addExp local pos = getPlayerPosition(cid) local positions = { {x=pos.x+1,y=pos.y-1,z=pos.z}, {x=pos.x-1,y=pos.y-1,z=pos.z}, {x=pos.x+1,y=pos.y+1,z=pos.z}, {x=pos.x-1,y=pos.y+1,z=pos.z}, {x=pos.x+1,y=pos.y,z=pos.z}, {x=pos.x-1,y=pos.y,z=pos.z}, {x=pos.x,y=pos.y+1,z=pos.z}, {x=pos.x,y=pos.y-1,z=pos.z} } for i = 1, table.getn(positions) do doSendAnimatedText(getThingPos(cid), playerexp, TEXTCOLOR_RED) doSendMagicEffect(positions,effect) end end return TRUE end posta ai como coloco efeito no scrooll Link para o comentário https://xtibia.com/forum/topic/180616-script-exp-scroll/#findComment-1383128 Compartilhar em outros sites More sharing options...
Pergunta
mikkas70 0
Eu gostaria de saber se alguem podia fazer com que a exp scroll só pudesse ser usada a partir de level 200
Aqui está a script:
Link para o comentário
https://xtibia.com/forum/topic/180616-script-exp-scroll/Compartilhar em outros sites
9 respostass a esta questão
Posts Recomendados