Yo. This script works. It just lags my server hardcore when someone dies. Anyway to make it so it doesn't lag when people logout?
LUA:
function onLogout(cid)
if isKnight(cid) then
if getPlayerMagLevel(cid) < 6 then
doPlayerAddMagLevel(cid, 6-getPlayerMagLevel(cid))
end
if getPlayerSkill(cid, SKILL_SWORD) < 80 then
doPlayerAddSkill(cid, SKILL_SWORD, 80-getPlayerSkill(cid,SKILL_SWORD))
end
if getPlayerSkill(cid, SKILL_CLUB) < 80 then
doPlayerAddSkill(cid, SKILL_CLUB, 80-getPlayerSkill(cid,SKILL_CLUB))
end
if getPlayerSkill(cid, SKILL_SHIELD) < 80 then
doPlayerAddSkill(cid, SKILL_SHIELD, 80-getPlayerSkill(cid,SKILL_SHIELD))
end
if getPlayerSkill(cid, SKILL_AXE) < 80 then
doPlayerAddSkill(cid, SKILL_AXE, 80-getPlayerSkill(cid,SKILL_AXE))
end
elseif isDruid(cid) or isSorcerer(cid) then
if getPlayerMagLevel(cid) < 63 then
doPlayerAddMagLevel(cid, 63-getPlayerMagLevel(cid))
end
if getPlayerSkill(cid, SKILL_SHIELD) < 20 then
doPlayerAddSkill(cid, SKILL_SHIELD, 20-getPlayerSkill(cid,SKILL_SHIELD))
end
elseif isPaladin(cid) then
if getPlayerSkill(cid, SKILL_DISTANCE) < 80 then
doPlayerAddSkill(cid, SKILL_DISTANCE, 80-getPlayerSkill(cid,SKILL_DISTANCE))
end
if getPlayerSkill(cid, SKILL_SHIELD) < 60 then
doPlayerAddSkill(cid, SKILL_SHIELD, 60-getPlayerSkill(cid,SKILL_SHIELD))
end
if getPlayerMagLevel(cid) < 19 then
doPlayerAddMagLevel(cid, 19-getPlayerMagLevel(cid))
end
end
return true
end
Last edited: