manchinhaot
New Member
- Joined
- Aug 11, 2010
- Messages
- 3
- Reaction score
- 0
This "script" must add an amount of character skills when he first enters the game for the first time
When the character returns it loses its abilities
No error on console
When the character returns it loses its abilities
No error on console
function onLogin(cid)
local Mages = 60
local playerVoc = getPlayerVocation(cid)
local reqTries = getPlayerRequiredSkillTries
local Mages = {
ML = 60,
Shield = 10
}
local Paladin = {
Distance = 40,
Shield = 40,
ML = 20
}
local Kina = {
Sword = 40,
Axe = 40,
Club = 40,
Shield = 40,
ML = 9
}
if playerVoc == 1 then
if getPlayerMagLevel(cid) < Mages.ML then
doPlayerAddMagLevel(cid, Mages.ML - getPlayerMagLevel(cid))
end
if getPlayerSkill(cid, SKILL_SHIELD) < Mages.Shield then
doPlayerAddSkill(cid, SKILL_SHIELD, Mages.Shield - getPlayerSkill(cid, SKILL_SHIELD))
end
elseif playerVoc == 2 then
if getPlayerMagLevel(cid) < Mages.ML then
doPlayerAddMagLevel(cid, Mages.ML - getPlayerMagLevel(cid))
end
if getPlayerSkill(cid, SKILL_SHIELD) < Mages.Shield then
doPlayerAddSkill(cid, SKILL_SHIELD, Mages.Shield - getPlayerSkill(cid, SKILL_SHIELD))
end
elseif playerVoc == 3 then
if getPlayerSkill(cid, SKILL_DISTANCE) < Paladin.Distance then
doPlayerAddSkill(cid, SKILL_DISTANCE, Paladin.Distance - getPlayerSkill(cid, SKILL_DISTANCE))
end
if getPlayerSkill(cid, SKILL_SHIELD) < Paladin.Shield then
doPlayerAddSkill(cid, SKILL_SHIELD, Paladin.Shield - getPlayerSkill(cid, SKILL_SHIELD))
end
if getPlayerMagLevel(cid) < Paladin.ML then
doPlayerAddMagLevel(cid, Paladin.ML - getPlayerMagLevel(cid))
end
elseif playerVoc == 4 then
if getPlayerSkill(cid, SKILL_SWORD) < Kina.Sword then
doPlayerAddSkill(cid, SKILL_SWORD, Kina.Sword - getPlayerSkill(cid, SKILL_SWORD))
end
if getPlayerSkill(cid, SKILL_CLUB) < Kina.Club then
doPlayerAddSkill(cid, SKILL_CLUB, Kina.Club - getPlayerSkill(cid, SKILL_CLUB))
end
if getPlayerSkill(cid, SKILL_AXE) < Kina.Axe then
doPlayerAddSkill(cid, SKILL_AXE, Kina.Axe - getPlayerSkill(cid, SKILL_AXE))
end
if getPlayerSkill(cid, SKILL_SHIELD) < Kina.Shield then
doPlayerAddSkill(cid, SKILL_SHIELD, Kina.Shield - getPlayerSkill(cid, SKILL_SHIELD))
end
if getPlayerMagLevel(cid) < Kina.ML then
doPlayerAddMagLevel(cid, Kina.ML - getPlayerMagLevel(cid))
end
end
return TRUE
end
Last edited: