Postado Abril 5, 2022 3 anos Fala galera to com uma duvida, como eu coloco esses 3 outfits por alavanca e retira os points? no spoiler tem o script que uso nas dos items mas ainda falta a dos outfits https://imgur.com/a/TTM1aSC Spoiler local lever = { [5550] = {5,2379}, [5551] = {5,7901}, [5552] = {5,2492}, [5553] = {5,2469}, [5554] = {5,2510}, [5555] = {5,2514}, [5556] = {5,2003}, [5557] = {5,2480}, [5558] = {5,2387}, } local storage,exausted = 98762,10 local Stackable = {8303,8310} -- coloque o ID aqui dos que só vem 1 function onUse(cid,item,fromPosition,itemEx,toPosition) if getPoints(cid) < lever[item.actionid][1] then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..lever[item.actionid][1].." points.") elseif getPlayerStorageValue(cid, storage) >= os.time() then return doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, storage) - os.time() .. " seconds to use this item again.") end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and isInArray(Stackable, lever[item.actionid][2]) and 1 or 100) removePoints(cid,lever[item.actionid][1]) setPlayerStorageValue(cid, storage, os.time()+exausted) doPlayerSendTextMessage(cid,22,"Você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) return true no spoiler abaixo o action points.lua Spoiler <action uniqueid="5550-5558" script="points.lua" /> abaixo deixo os dados do outfit que quero que ganhe por 5 points Spoiler <outfit id="12" premium="0" quest="99012"> <list gender="0" lookType="221" name="Deadpool"/> <list gender="1" lookType="221" name="Deadpool"/> </outfit>
Postado Abril 7, 2022 3 anos Solução local lever = { [5550] = {type = "items", amount = 5, id = 2379}, [5551] = {type = "items", amount = 5, id = 7901}, [5552] = {type = "items", amount = 5, id = 2492}, [5553] = {type = "items", amount = 5, id = 2469}, [5554] = {type = "items", amount = 5, id = 2510}, [5555] = {type = "items", amount = 5, id = 2514}, [5556] = {type = "items", amount = 5, id = 2003}, [5557] = {type = "items", amount = 5, id = 2480}, [5558] = {type = "items", amount = 5, id = 2387}, [5559] = {type = "outfit", amount = 5, name="Deadpool", sex = {[0] = 221, [1] = 221}, addon = 3, storage = 785481} } local storage,exausted = 98762,10 local stackable = {8303,8310} -- coloque o ID aqui dos que só vem 1 function onUse(cid,item,fromPosition,itemEx,toPosition) local ret = lever[item.actionid] if getPoints(cid) < ret.amount then doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..ret.amount.." points.") return true elseif getPlayerStorageValue(cid, storage) >= os.time() then doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, storage) - os.time() .. " seconds to use this item again.") return true end if ret.type == "items" then doPlayerAddItem(cid, ret.id, isItemStackable(ret.id) and isInArray(stackable, ret.id) and 1 or 100) doPlayerSendTextMessage(cid,22,"Você comprou um " .. getItemNameById(ret.id)) elseif ret.type == "outfit" then if getPlayerStorageValue(cid, ret.storage) > 0 then doPlayerSendCancel(cid, "voce ja comprou essa outfit.") return true end setPlayerStorageValue(cid, ret.storage, 1) doPlayerSendTextMessage(cid,22,"Você recebeu uma outfit: " .. ret.name) doPlayerAddOutfit(cid, ret.sex[getPlayerSex(cid)], ret.addon) end removePoints(cid, ret.amount) setPlayerStorageValue(cid, storage, os.time()+exausted) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) return true end agora poderá outras outfits quando quiser. [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Abril 7, 2022 3 anos Autor 10 horas atrás, Vodkart disse: local lever = { [5550] = {type = "items", amount = 5, id = 2379}, [5551] = {type = "items", amount = 5, id = 7901}, [5552] = {type = "items", amount = 5, id = 2492}, [5553] = {type = "items", amount = 5, id = 2469}, [5554] = {type = "items", amount = 5, id = 2510}, [5555] = {type = "items", amount = 5, id = 2514}, [5556] = {type = "items", amount = 5, id = 2003}, [5557] = {type = "items", amount = 5, id = 2480}, [5558] = {type = "items", amount = 5, id = 2387}, [5559] = {type = "outfit", amount = 5, name="Deadpool", sex = {[0] = 221, [1] = 221}, addon = 3, storage = 785481} } local storage,exausted = 98762,10 local stackable = {8303,8310} -- coloque o ID aqui dos que só vem 1 function onUse(cid,item,fromPosition,itemEx,toPosition) local ret = lever[item.actionid] if getPoints(cid) < ret.amount then doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Você precisa de "..ret.amount.." points.") return true elseif getPlayerStorageValue(cid, storage) >= os.time() then doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, storage) - os.time() .. " seconds to use this item again.") return true end if ret.type == "items" then doPlayerAddItem(cid, ret.id, isItemStackable(ret.id) and isInArray(stackable, ret.id) and 1 or 100) doPlayerSendTextMessage(cid,22,"Você comprou um " .. getItemNameById(ret.id)) elseif ret.type == "outfit" then if getPlayerStorageValue(cid, ret.storage) > 0 then doPlayerSendCancel(cid, "voce ja comprou essa outfit.") return true end setPlayerStorageValue(cid, ret.storage, 1) doPlayerSendTextMessage(cid,22,"Você recebeu uma outfit: " .. ret.name) doPlayerAddOutfit(cid, ret.sex[getPlayerSex(cid)], ret.addon) end removePoints(cid, ret.amount) setPlayerStorageValue(cid, storage, os.time()+exausted) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) return true end agora poderá outras outfits quando quiser. R-E-S-O-L-V-I-D-O, só tive que alterar a storage (obviamente) e colocar as que usei no outfits.xml. Mas tudo resolvido!! Muito obrigado você é demais!
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.