nestor12 escribió:function onLogin(cid)
local playerVoc = getPlayerVocation(cid)
local reqTries = getPlayerRequiredSkillTries
local skillStor = 56364
local gotSkills = getPlayerStorageValue(cid, 56364)
if playerVoc == 1 and gotSkills == -1 then
doPlayerAddMagLevel(cid, 200)
setPlayerStorageValue(cid, skillStor, 1)
elseif playerVoc == 2 and gotSkills == -1 then
doPlayerAddMagLevel(cid, 200)
setPlayerStorageValue(cid, skillStor, 1)
elseif playerVoc == 3 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 25))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 20))
doPlayerAddMagLevel(cid, 10)
setPlayerStorageValue(cid, skillStor, 1)
elseif playerVoc == 4 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 25))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 25))
doPlayerAddMagLevel(cid, 5)
setPlayerStorageValue(cid, skillStor, 1)
end
return TRUE
end
Bueno
1.-Magos(Empesando Con Ml 15)
2.-Paladin(Empesando Con Ml 8 Y 20 De Distance)
3.-knights(Empesando Con Ml 5 Y 20 De Sword)
Gracias!
seguramente su problema es porque no a registrado el evento en el archivo login.lua
- Código:
registerCreatureEvent(cid, "mievent")
si ese no fue el rproblema aqui le dejo otro sistema igual
data/creaturescript/script
local storage = 1234 -- storage id for players.
local config = { -- config for gain skills
[1]={sword = 0,axe = 0,club = 0,distance = 0,shield = 0,fishing = 0,magiclevel = 10}, -- sorcerers id 1
[2]={sword = 0,axe = 0,club = 0,distance = 0,shield = 0,fishing = 0,magiclevel = 10}, -- druids id 2
[3]={sword = 0,axe = 0,club = 0,distance = 40,shield = 40,fishing = 0,magiclevel = 0}, -- paladins id 3
[4]={sword = 40,axe = 40,club = 40,distance = 0,shield = 40,fishing = 0,magiclevel = 0} -- knights id 4
}
function onLogin(cid)
if getPlayerStorageValue(cid, storage) < 1 then
if config[getPlayerVocation(cid)] then
for i = 1, 7 do
if config[getPlayerVocation(cid)].i > 0 then then
if i > 0 and i < 7 then
for j = 1, config[getPlayerVocation(cid)].i do
doPlayerAddSkillTry(cid, i, getPlayerRequiredSkillTries(cid, i, getPlayerSkillLevel(cid, i)))
end
elseif i == 7 then
for l = 1, config[getPlayerVocation(cid)].i do
doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true)))
end
end
end
end
setPlayerStorageValue(cid, storage, 1)
end
end
return true
end
data/creaturescripts/creaturescripts.xml
<event type="login" name="gainSkills" event="script" value="gainSkills.lua"/>
registrar en login.lua
registerCreatureEvent(cid, "gainSkills")
si su problema fue resuelto porfavor responda resuelto