• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Start Skill

lostenhoz

New Member
Joined
Aug 31, 2020
Messages
29
Reaction score
0
I have a script that gives the skill when the character enters, but the script is lagging the server and doesn’t deliver all the skill
in the config for knight is 80, but he only delivers 62
i use tfs 0.4 3777


Lua:
function onLogin(cid)

    local playerVoc = getPlayerVocation(cid)

    local reqTries = getPlayerRequiredSkillTries

    local skillStor = 56364

    local gotSkills = getPlayerStorageValue(cid, 56364)



    if playerVoc == 5 and gotSkills == -1 then

        doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, 1)))

        setPlayerStorageValue(cid, skillStor, 1)

    elseif playerVoc == 6 and gotSkills == -1 then

        doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, 12)))

        setPlayerStorageValue(cid, skillStor, 1)

    elseif playerVoc == 7 and gotSkills == -1 then

        doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 10))

        doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 10))

        doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,3)))

        setPlayerStorageValue(cid, skillStor, 1)

    elseif playerVoc == 8 and gotSkills == -1 then

        doPlayerAddSkillTry(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 80))

        doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 80))

        doPlayerAddSkillTry(cid, SKILL_CLUB, reqTries(cid, SKILL_CLUB, 80))

        doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 80))

        doPlayerAddMagLevel(cid, 1)

        setPlayerStorageValue(cid, skillStor, 1)

    end



    return TRUE

end
 
I have just tested your code and the lagging (infinite loop) occured when the player distance was too great.
dist.png

Do you have any characters with a skill amount above the maximum limits ?

Run this query in your database to see players with highest skills:
SQL:
SELECT * FROM `player_skills` ORDER BY `value` DESC LIMIT 10;
 
Last edited:
Back
Top