• 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!

Server freeze with doPlayerAddSkill function when logging in

petracyus

New Member
Joined
Jun 4, 2010
Messages
14
Reaction score
0
So I am trying to create a new War Server and I came across an issue.
Since ur supposed to start at lv 85 and with specific skills I tried to add a function that a new player would log in and immediately get skill 75, for example.
But since that, everytime a new player logs in after character creation - specifically Knights cuz they have more skills (axe,sword,club) - the server freezes/lag for a second.

The script is:
Lua:
local playerVocation = config.firstSkills[getPlayerVocation(cid)]
if(not playerVocation) then
    return true
end
if(getCreatureStorage(cid, skillStorage) == -1) then
    for i = 1, #playerVocation do
        if(playerVocation[i].skillid) then
            doPlayerAddSkill(cid, playerVocation[i].skillid, playerVocation[i].skillLevel)
        end
        if (playerVocation[i].amount) then
            doPlayerAddMagLevel(cid, playerVocation[i].amount)
        end
    end
end

Is there anyway I can make the script better for it not to lag the server or even a better way to fix this problem?

Client Version: 8.60
TFS version: 0.3.7-r5969-win32

Also the character is created with Account Manager in-game (we don't want a site yet)
 
What I did long time ago to my server (cuz I also have acc manager) was setting 2 triggers when adding a new player entry into the database
Just go to your players table and add the following triggers

magic_trigger <code here>

ea9e01a8b25450a5314bd0e15e0c18e4.png

skills_trigger <code here> (I believe this one is already created, just edit it if thats the case)
357cb0b62d8545ee8e46ed79de6c893e.png
 
What I did long time ago to my server (cuz I also have acc manager) was setting 2 triggers when adding a new player entry into the database
Just go to your players table and add the following triggers

magic_trigger <code here>

View attachment 76680

skills_trigger <code here> (I believe this one is already created, just edit it if thats the case)
THXX
 
Back
Top