Postado Setembro 1, 2018 6 anos Fala Galera, alguem me ajuda a criar um script de um item que ao ser usado o player ganha Skills Permanente ? Exemplo > Ao Usar X Item, o Player ganha 5 Leveis em Magic Level, Fist Fighting, Axe Fighting, Club Fighting, Distance Fighting e Shield ? Montei uma base para o script mas não consegui fazer, se possível utilizar essa base. Tentei utilizar usando a função doPlayerAddSkillTry mas não deu certo. TFS 0.4 function onUse(cid, item, fromPosition, itemEx, toPosition) local position1 = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if getPlayerStorageValue(cid, 344240) < 1 then if getPlayerLevel(cid) >= 400 then -- doPlayerPopupFYI(cid, "Parabens, voce acaba de maximizar o seu personagem!") doSendMagicEffect(position1, 5) setPlayerStorageValue(cid,344240,1) else selfSay('Voce nao tem Level Suficiente !', cid) doSendMagicEffect(getPlayerPosition(cid), 3) end else selfSay('Voce ja utilizou esse Max Scroll Antes !', cid) doSendMagicEffect(getPlayerPosition(cid), 3) end end
Postado Setembro 1, 2018 6 anos Solução @r0bert0lol local lvl_min = 400 -- Leve mínimo para usar o script. local storage = 344240 -- Para não usar o script novamente. local skills_t = { {skill = SKILL_CLUB, count_lvl = 10}, {skill = SKILL_SWORD, count_lvl = 10}, {skill = SKILL_AXE, count_lvl = 10} } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, storage) < 1 then if getPlayerLevel(cid) >= lvl_min then doPlayerPopupFYI(cid, "Parabens, voce acaba de maximizar o seu personagem!") doSendMagicEffect(getPlayerPosition(cid), 5) setPlayerStorageValue(cid, storage, 1) for _, t in pairs(skills_t) do doPlayerAddSkill(cid, t.skill, t.count_lvl) end else selfSay('Voce nao tem Level Suficiente !', cid) doSendMagicEffect(getPlayerPosition(cid), 3) end else selfSay('Voce ja utilizou esse Max Scroll Antes !', cid) doSendMagicEffect(getPlayerPosition(cid), 3) end return true end
Postado Setembro 1, 2018 6 anos @r0bert0lol local cfg = { level = 400, effect = 30, addLevel = { [1] = {ID_LEVEL = SKILL_AXE, quant = 1}, [2] = {ID_LEVEL = SKILL_SWORD, quant = 1}, [3] = {ID_LEVEL = SKILL_LEVEL, quant = 1}, [4] = {ID_LEVEL = SKILL_CLUB, quant = 1} }, storage = 344240, } function onUse(cid, item, fromPosition, itemEx, toPosition) local posPlayer = getPlayerPosition(cid) if not getPlayerStorageValue(cid, cfg.storage) < 1 then doPlayerSendTextMessage(cid, 23, "Voce ja usou o item.") doSendMagicEffect(posPlayer, cfg.effect) return false end if not getPlayerLevel(cid) >= cfg.level then doPlayerSendTextMessage(cid, 23, "Voce nao possui nivel.") doSendMagicEffect(posPlayer, cfg.effect) return false end for i = 1, #cfg.addLevel do doPlayerAddSkill(cid, cfg.addLevel[i].ID_LEVEL, cfg.addLevel[i].quant) end setPlayerStorageValue(cid, cfg.storage, 1) return true end Meus trabalhos: [Movements] TFS 1.1+ Area Hardcore [Movements] TFS 1.1+ Tile Party [Action] TFS 1.1+ Bau diário [Action] TFS 1.1+ Guild Dungeon Lever [Talkactions] TFS 0.3.6 / 0.4 Quest Hunt por Tempo Contato: Discord: Tataboy67#4934
Postado Setembro 1, 2018 6 anos Autor @KotZletY Quanto ao Seu script ele funcionou porem não como desejava, o script não está adicionando Leveis Exatos. Se eu colocar por exemplo, count_lvl = 10}, O Player ganha apenas 1 Level, e se ele já estiver com skill Alta tipo 80 + ele recebe apenas alguns % do level. @tataboy67 Quanto ao seu Script, está gerando esse erro ao usar o item. [19:20:32.703] [Error - Action Interface] [19:20:32.703] data/actions/scripts/max skills.lua:onUse [19:20:32.703] Description: [19:20:32.703] data/actions/scripts/max skills.lua:18: attempt to compare boolean with number [19:20:32.703] stack traceback: [19:20:32.703] data/actions/scripts/max skills.lua:18: in function <data/actions/scripts/max skills.lua:14>
Postado Setembro 1, 2018 6 anos 3 minutos atrás, r0bert0lol disse: porem não como desejava Você não explicou como "desejava".
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.