Postado Janeiro 6, 2016 9 anos Olá, galera queria como editar a chance de quebrar o vaso da catacumba, de preferencia tirar essa chance , para quando o player clicar ele quebrar e nao ter chance de quebrar local config = { randomText = {"Waaaaaah", "You are too afraid to destroy this object"}, } function onUse(cid, item, fromPosition, itemEx, toPosition) local exaustedSeconds = 30 local player = Player(cid) local chances = math.random(10) if item.actionid == 56530 then if(item.itemid == 13736) then if getPlayerStorageValue(cid, 324329) <= os.time() then if chances == 1 then doTransformItem(item.uid, 13495) -- Sumonar Boss doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1) addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) else player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1) player:getPosition():sendMagicEffect(CONST_ME_POFF) setPlayerStorageValue(cid, 324329, os.time()+exaustedSeconds*60) end else doPlayerSendCancel(cid, "You need wait 30 minutes to use again.") end end elseif item.actionid == 56531 then if(item.itemid == 13500) then if(getGlobalStorageValue(56531) < 1) then if getPlayerStorageValue(cid, 324330) <= os.time() then if chances == 1 then doTransformItem(item.uid, 13495) -- Sumonar Boss doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1) addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) else player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1) player:getPosition():sendMagicEffect(CONST_ME_POFF) setPlayerStorageValue(cid, 324330, os.time()+exaustedSeconds*60) end else doPlayerSendCancel(cid, "You need wait 30 minutes to use again.") end else doPlayerSendCancel(cid, "You need to break the first jar.") end end elseif item.actionid == 56532 then if(item.itemid == 13500) then if(getGlobalStorageValue(56532) < 1) then if getPlayerStorageValue(cid, 324331) <= os.time() then if chances == 1 then doTransformItem(item.uid, 13495) -- Sumonar Boss doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1) addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) else player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1) player:getPosition():sendMagicEffect(CONST_ME_POFF) setPlayerStorageValue(cid, 324331, os.time()+exaustedSeconds*60) end else doPlayerSendCancel(cid, "You need wait 30 minutes to use again.") end else doPlayerSendCancel(cid, "You need to break the second jar.") end end elseif item.actionid == 56533 then if(item.itemid == 13500) then if(getGlobalStorageValue(56533) < 1) then if getPlayerStorageValue(cid, 324332) <= os.time() then if chances == 1 then doTransformItem(item.uid, 13495) -- Sumonar Boss doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1) addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) else player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1) player:getPosition():sendMagicEffect(CONST_ME_POFF) setPlayerStorageValue(cid, 324332, os.time()+exaustedSeconds*60) end else doPlayerSendCancel(cid, "You need wait 30 minutes to use again.") end else doPlayerSendCancel(cid, "You need to break the third jar.") end end elseif item.actionid == 56534 then if(item.itemid == 13736) then if(getGlobalStorageValue(56534) < 1) then if getPlayerStorageValue(cid, 324333) <= os.time() then if chances == 1 then doTransformItem(item.uid, 13495) -- Sumonar Boss doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1) addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) else player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1) player:getPosition():sendMagicEffect(CONST_ME_POFF) setPlayerStorageValue(cid, 324333, os.time()+exaustedSeconds*60) end else doPlayerSendCancel(cid, "You need wait 30 minutes to use again.") end else doPlayerSendCancel(cid, "You need to break the third jar.") end end end return true end Editado Janeiro 6, 2016 9 anos por markimbozi (veja o histórico de edições)
Postado Janeiro 6, 2016 9 anos se você retirar essas linhas o vaso não vai mais quebrar não doTransformItem(item.uid, 13495) lembrando que ela se repete varias vezes terá de retirar todas se você quiser também pode alterar a mensagem q aparece quando falhar The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes
Postado Janeiro 6, 2016 9 anos Autor @wevertonvrb o negocio é que para quebrar o vaso tem uma chance, e a ela falha muito , e eu quero tirar essa chance de falhar eu quero 100% de chance de quebrar o vaso
Postado Janeiro 6, 2016 9 anos entendo então é nessa parte local chances = math.random(10) tente por 100 e testa se n resolver coloque 1 e teste novamente ou voce pode mudar essa parte tb if chances == 1 then onde ta == você pode deixar >= Editado Janeiro 6, 2016 9 anos por wevertonvrb (veja o histórico de edições)
Postado Janeiro 6, 2016 9 anos @wevertonvrb Desculpe, mas vc está equivocado. Quando há a função math.random ele varia de uma maneira aleatória de 0 a 10 (uma vez que no caso o número máximo é 10). Assim, se colocar 100 a chance vai ficar menor ainda. Pra retirar a chance onde consta: local chances = math.random(10) Mude para: local chances = 1 The Last Man Standing - 100% funcional
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.