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:
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)
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)