faz o mesmo processo no onLogin.
- Fórum
- OTServ
- Suporte
- Resolvidos
- [Resolvido] [Suporte] Script bugado
Agora, Nogard disse:faz o mesmo processo no onLogin.
nosgard vou testar mas se eu te dizer que testei em tudo menos usando onlogin kkkkk vou testar já edito
ta faltando a função login no script
[Warning - Event::loadScript] Event onLogin not found (data/creaturescripts/scripts/skillblock.lua)
local skills = { [sKILL_FIST] = {maxLevel = 249}, [sKILL_SWORD] = {maxLevel = 249}, [sKILL_AXE] = {maxLevel = 249}, [sKILL_CLUB] = {maxLevel = 249}, [sKILL_DISTANCE] = {maxLevel = 249}, [sKILL_SHIELD] = {maxLevel = 249}, [sKILL_FISHING] = {maxLevel = 249}, [sKILL__MAGLEVEL] = {maxLevel = 150},}function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel > i.maxLevel then doPlayerSetRate(cid, skill, 0.0) doPlayerSave(cid) return false end end return trueend
tenta dar um save, mais fácil
Agora, Nogard disse:local skills = { [SKILL_FIST] = {maxLevel = 249}, [SKILL_SWORD] = {maxLevel = 249}, [SKILL_AXE] = {maxLevel = 249}, [SKILL_CLUB] = {maxLevel = 249}, [SKILL_DISTANCE] = {maxLevel = 249}, [SKILL_SHIELD] = {maxLevel = 249}, [SKILL_FISHING] = {maxLevel = 249}, [SKILL__MAGLEVEL] = {maxLevel = 150}, } function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel > i.maxLevel then doPlayerSetRate(cid, skill, 0.0) doPlayerSave(cid) return false end end return true end
tenta dar um save, mais fácil
não deu certo continua upando ao relogar
não tem como colocar o onLogin(cid)
na script junto com o advance?
Quanto menos gambiarra melhor pra você, mano. Chegando em casa eu vejo isso pra ti.
1 hora atrás, Nogard disse:Quanto menos gambiarra melhor pra você, mano. Chegando em casa eu vejo isso pra ti.
blz vlw ^^
@Nogard pode dar uma força aqui mano tentei editar de todo jeito e nada kkk
Quando o cara reloga é adicionado + 1 level na skill? É isso? Porque deveria ser indiferente o ato de relogar, isso seria executado sempre que tentasse avançar, mesmo que a rate não estivesse em 0.
Agora, Nogard disse:Quando o cara reloga é adicionado + 1 level na skill? É isso? Porque deveria ser indiferente o ato de relogar, isso seria executado sempre que tentasse avançar, mesmo que a rate não estivesse em 0.
ao relogar o player pode treinar mais uma skill ai bloqueia novamente ai o player reloga e treina mais uma skill ai bloqueia a skill maxima denovo o player reloga e fica nisso em um clico infinito
Editado Julho 6 por Brunds
tenta dessa forma:
local skills = { [SKILL_FIST] = {maxLevel = 249}, [SKILL_SWORD] = {maxLevel = 249}, [SKILL_AXE] = {maxLevel = 249}, [SKILL_CLUB] = {maxLevel = 249}, [SKILL_DISTANCE] = {maxLevel = 249}, [SKILL_SHIELD] = {maxLevel = 249}, [SKILL_FISHING] = {maxLevel = 249}, [SKILL__MAGLEVEL] = {maxLevel = 150},}function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel == i.maxLevel then doPlayerSetSkillRate(cid, skill, 0.0) doPlayerSave(cid) return true end end return trueend
o player upa normal a skill como se não tivesse trava
Nesse caso só vai funcionar ao avançar ao limite exato, não acima. O cara vai chegar no limite e ficar por ali.
Agora, Nogard disse:Nesse caso só vai funcionar ao avançar ao limite exato, não acima. O cara vai chegar no limite e ficar por ali.
um maninho me passou um aqui nogard que resolveu vou postar pra você ver
local skills = {
[SKILL_FIST] = {maxLevel = 249},
[SKILL_SWORD] = {maxLevel = 249},
[SKILL_AXE] = {maxLevel = 249},
[SKILL_CLUB] = {maxLevel = 249},
[SKILL_DISTANCE] = {maxLevel = 249},
[SKILL_SHIELD] = {maxLevel = 249},
[SKILL_FISHING] = {maxLevel = 249},
[SKILL__MAGLEVEL] = {maxLevel = 150},
}
function onAdvance(cid, skill, oldLevel, newLevel)
local i = skills[skill]
if i then
if newLevel > i.maxLevel then
doPlayerSetRate(cid, skill, 0.0)
doPlayerSave(cid)
doPlayerSetStorageValue(cid, skill+10000, 1)
return false
end
end
return true
end
e um segundo com
function onLogin(cid)
if getPlayerStorageValue(cid, 0+10000) == 1 then
doPlayerSetRate(cid, 0, 0.0)
end
if getPlayerStorageValue(cid, 1+10000) == 1 then
doPlayerSetRate(cid, 1, 0.0)
end
if getPlayerStorageValue(cid, 2+10000) == 1 then
doPlayerSetRate(cid, 2, 0.0)
end
if getPlayerStorageValue(cid, 3+10000) == 1 then
doPlayerSetRate(cid, 3, 0.0)
end
if getPlayerStorageValue(cid, 4+10000) == 1 then
doPlayerSetRate(cid, 4, 0.0)
end
if getPlayerStorageValue(cid, 5+10000) == 1 then
doPlayerSetRate(cid, 5, 0.0)
end
if getPlayerStorageValue(cid, 6+10000) == 1 then
doPlayerSetRate(cid, 6, 0.0)
end
if getPlayerStorageValue(cid, 7+10000) == 1 then
doPlayerSetRate(cid, 7, 0.0)
end
return true
end
o primeiro com onadvance e o segundo com onlogin




info
Grupo: Marquês
Registrado: 05/12/11
Posts: 1.2k
Reputação: +173
Gênero: Masculino
Fala guys achei esse script no fórum de limitar as skills porém ao atingir o limite e relogar o player pode upar mais uma skill ao relogar outra skill até bugar ou ao infinito alguém pode me ajudar a solucionar esse bug? de quando o player relogar não poder passar do limite da skill estipulado no script?
Script