Postado Fevereiro 20, 2023 2 anos Testa: local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402 } local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011 local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) if not isInArray(waterIds, item2.itemid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.") return true end if check < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.") return true end if ((math.random(1, 100000)) <= (skill * 500)) then if skill > 50 then amount = math.random(1, ((skill / 10) - 3)) end doPlayerAddItem(cid, 2667, amount) if amount > 7 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!") end end doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate)) setPlayerStorageValue(cid, storage, (now + config.cooldown)) return true end Editado Fevereiro 20, 2023 2 anos por Anderson Sacani (veja o histórico de edições)
Postado Fevereiro 20, 2023 2 anos Autor 2 minutos atrás, Anderson Sacani disse: Testa: local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402 } local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011 local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) if not isInArray(waterIds, item2.itemid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You can only use the fishing rod in the water.") return true end if check < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.") return true end if ((math.random(1, 100000)) <= (skill * 500)) then if skill > 50 then amount = math.random(1, ((skill / 10) - 3)) end doPlayerAddItem(cid, 2667, amount) if amount > 7 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!") end end doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate)) setPlayerStorageValue(cid, storage, (now + config.cooldown)) return true end funcionou certinho, mas não aparece a animação de quando pesca, sabe? esqueci de mencionar no comentário anterior, perdão!
Postado Fevereiro 20, 2023 2 anos local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402 } local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011 local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) if not isInArray(waterIds, item2.itemid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.") return true end if check < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.") return true end if ((math.random(1, 100000)) <= (skill * 500)) then if skill > 50 then amount = math.random(1, ((skill / 10) - 3)) end doPlayerAddItem(cid, 2667, amount) if amount > 7 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!") end end doSendMagicEffect(topos, CONST_ME_LOSEENERGY) doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate)) setPlayerStorageValue(cid, storage, (now + config.cooldown)) return true end
Postado Fevereiro 20, 2023 2 anos Autor 3 minutos atrás, Anderson Sacani disse: local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402 } local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011 local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) if not isInArray(waterIds, item2.itemid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.") return true end if check < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.") return true end if ((math.random(1, 100000)) <= (skill * 500)) then if skill > 50 then amount = math.random(1, ((skill / 10) - 3)) end doPlayerAddItem(cid, 2667, amount) if amount > 7 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!") end end doSendMagicEffect(topos, CONST_ME_LOSEENERGY) doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate)) setPlayerStorageValue(cid, storage, (now + config.cooldown)) return true end funcionou certinho, obrigado! rep+
Postado Março 15, 2023 2 anos Autor Em 20/02/2023 em 18:44, Anderson Sacani disse: local config = { rate = 10, -- Speed at which the skill will progress cooldown = 2, -- Time in seconds of character exhaustion } function onUse(cid, item, frompos, item2, topos) local waterIds = { 493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402 } local skill, amount, storage = getPlayerSkill(cid, 6), 1, 6873565011 local now = os.time() local check = (now - getPlayerStorageValue(cid, storage)) if not isInArray(waterIds, item2.itemid) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You can only use the fishing rod in the water.") return true end if check < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are exhausted.") return true end if ((math.random(1, 100000)) <= (skill * 500)) then if skill > 50 then amount = math.random(1, ((skill / 10) - 3)) end doPlayerAddItem(cid, 2667, amount) if amount > 7 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've caught more than 7 fish!") end end doSendMagicEffect(topos, CONST_ME_LOSEENERGY) doPlayerAddSkillTry(cid, LEVEL_SKILL_FISHING, (1 * config.rate)) setPlayerStorageValue(cid, storage, (now + config.cooldown)) return true end Olá amigo, peço desculpas por reviver este tópico, mas quando se pesca com a fishing rod está aumento o skill fist fighting e não o fishing, saberia como resolver? já tentei mudar no getPlayerSkill(cid, 6) mas aparentemente este é o skill de fishing mesmo Edit: Consegui arrumar, ao invés de LEVEL_SKILL_FISHING coloquei somente SKILL_FISHING e deu certo! Editado Março 15, 2023 2 anos por yuriowns (veja o histórico de edições)
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.