Postado Dezembro 14, 2014 10 anos Olá pessoal, tenho um script de limite de skills porem ele não limita a magic level alguém pode ajudar? function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL_SWORD then if getPlayerSkillLevel(cid, SKILL_SWORD) >= 171 then doPlayerSetRate(cid, SKILL_SWORD, 0.0) end elseif skill == SKILL_SWORD then if getPlayerSkillLevel(cid, SKILL_FIST) >= 171 then doPlayerSetRate(cid, SKILL_FIST, 0.0) end return false elseif skill == SKILL_AXE then if getPlayerSkillLevel(cid, SKILL_AXE) >= 171 then doPlayerSetRate(cid, SKILL_AXE, 0.0) end return false elseif skill == SKILL_CLUB then if getPlayerSkillLevel(cid, SKILL_CLUB) >= 171 then doPlayerSetRate(cid, SKILL_CLUB, 0.0) end return false elseif skill == SKILL_DISTANCE then if getPlayerSkillLevel(cid, SKILL_DISTANCE) >= 171 then doPlayerSetRate(cid, SKILL_DISTANCE, 0.0) end return false elseif skill == SKILL_SHIELD then if getPlayerSkillLevel(cid, SKILL_FIST) >= 171 then doPlayerSetRate(cid, SKILL_FIST, 0.0) end return false elseif skill == SKILL_FISH then if getPlayerSkillLevel(cid, SKILL_FISH) >= 171 then doPlayerSetRate(cid, SKILL_FISH, 0.0) end return false end end
Postado Dezembro 14, 2014 10 anos Não testei. local skills = { [SKILL_SWORD] = {maxLevel = 171}, [SKILL_AXE] = {maxLevel = 171}, [SKILL_CLUB] = {maxLevel = 171}, [SKILL_DISTANCE] = {maxLevel = 171}, [SKILL_SHIELD] = {maxLevel = 171}, [SKILL_FISH] = {maxLevel = 171}, [SKILL__MAGLEVEL] = {maxLevel = 171}, } function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel >= i.maxLevel then return false end end return true end Tony Araújo
Postado Dezembro 14, 2014 10 anos Autor Em 14/12/2014 em 11:00, Orochi Elf disse: Não testei. local skills = { [SKILL_SWORD] = {maxLevel = 171}, [SKILL_AXE] = {maxLevel = 171}, [SKILL_CLUB] = {maxLevel = 171}, [SKILL_DISTANCE] = {maxLevel = 171}, [SKILL_SHIELD] = {maxLevel = 171}, [SKILL_FISH] = {maxLevel = 171}, [SKILL__MAGLEVEL] = {maxLevel = 171}, } function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel >= i.maxLevel then return false end end return true end Valeu lek, vou testar. Deu error.. [10:5:12.996] [Error - Test Interface] [10:5:12.996] data/creaturescripts/scripts/skillblock.lua [10:5:12.996] Description: [10:5:12.996] data/creaturescripts/scripts/skillblock.lua:7: table index is nil[10:5:12.996] [Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/skillblock.lua)
Postado Dezembro 14, 2014 10 anos Bom.. é porque no caso a variavel "SKILL_FISH", não existe, agora que eu fui ver, eu fui me baseando no seu script. local skills = { [SKILL_SWORD] = {maxLevel = 171}, [SKILL_AXE] = {maxLevel = 171}, [SKILL_CLUB] = {maxLevel = 171}, [SKILL_DISTANCE] = {maxLevel = 171}, [SKILL_SHIELD] = {maxLevel = 171}, [SKILL_FISHING] = {maxLevel = 171}, [SKILL__MAGLEVEL] = {maxLevel = 171}, } function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel >= i.maxLevel then return false end end return true end Tony Araújo
Postado Dezembro 14, 2014 10 anos Autor Em 14/12/2014 em 12:19, Orochi Elf disse: Bom.. é porque no caso a variavel "SKILL_FISH", não existe, agora que eu fui ver, eu fui me baseando no seu script. local skills = { [SKILL_SWORD] = {maxLevel = 171}, [SKILL_AXE] = {maxLevel = 171}, [SKILL_CLUB] = {maxLevel = 171}, [SKILL_DISTANCE] = {maxLevel = 171}, [SKILL_SHIELD] = {maxLevel = 171}, [SKILL_FISHING] = {maxLevel = 171}, [SKILL__MAGLEVEL] = {maxLevel = 171}, } function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel >= i.maxLevel then return false end end return true end Não deu erro mas também não limitou
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.