• 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 lags when killing legendary (Pokétibia)

RadkeShady

New Member
Joined
Aug 1, 2021
Messages
5
Reaction score
0
Hi, I have a Pokétibia server (Base Poke Imperium), normally it runs with CPU usage at 3 to 10%, the current problem is:

When players attack Legends (Pokémon (Wild Monster) with a lot of HP, DEF, ATK... etc)
the server lags a lot and CPU usage goes to 100%.

PS: This problem disappears sometimes, and reappears out of nowhere xd'
I would like to ask for help with this, my Game has been online for 2 years and it has always been like this.

tfs version 0.3.6.
VPS Linux ubuntu-14.04-x86_64 4x
CPU - 10gb RAM

Sorry for bad english i use google translator.
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
899
Solutions
21
Reaction score
429
Location
Santiago - Chile
OP
OP
R

RadkeShady

New Member
Joined
Aug 1, 2021
Messages
5
Reaction score
0
Is there any onKill function related to the legendary monsters? Try to load this script in any lib [ANY TFS] Catch scripts that freeze server (https://otland.net/threads/any-tfs-catch-scripts-that-freeze-server.261466/) should work on 0.3.6. Also run the server on command shell to see if it triggers any error, tfs 1.3 compile windows error (https://otland.net/threads/tfs-1-3-compile-windows-error.277248/#post-2666281)

Hi, thanks for answer me

This is the only file I have onKill of legendary


local pokemons = {"Registeel", "Regirock", "Regice", "Mega Diancie", "Deoxys Attack", "Deoxys Defense", "Deoxys Speed", "Deoxys", "Yveltal", "Meloetta Pirouette", "Primal Kyogre", "Victini", "Primal Groudon", "Mega Rayquaza", "Lunala", "Solgaleo", "Hoopa Confined", "Hoopa Unbound", "Thundurus Therian", "Tornadus Therian", "Landorus Therian", "Diancie", "Kyurem White", "Kyurem Black", "Raikou", "Entei","Suicune","Zapdos", "Moltres", "Articuno","Mewtwo","Mew","Lugia","Ho-oh","Celebi","Latios","Latias","Phione","Manaphy","Uxie","Mesprit","Azelf","Arceus","Cresselia","Meloetta Aria","Keldeo","Genesect","Shaymin","Deoxys Normal","Jirachi","Darkrai","Kyogre","Heatran","Rayquaza","Groudon","Dialga","Palkia","Giratina","Tornadus Incarnate","Thundurus Incarnate","Landorus Incarnate","Kyurem","Zygarde 50","Zygarde 10"}


function onKill(cid, target, lastHit)
if isInArray(pokemons,getCreatureName(target)) then
doBroadcastMessage("O jogador "..getCreatureName(cid).." matou o Pokemon Lendario "..getCreatureName(target).."!")
end
return true


end
 

Red

Cyntara.org
Staff member
Global Moderator
Premium User
Joined
Aug 9, 2008
Messages
4,437
Solutions
1
Reaction score
891
Location
United States
The code that you posted does not seem complex. You should also check functions that execute in onDeath/onPrepareDeath for creatures as onKill is simply one method that can be used.

However, you mentioned that the issue appears to happen when you’re attacking a Pokémon with high stats. This would likely be from an onStatsChange function or any function that executes each time a Pokemon is attacked.

Ideally you would be able to produce this with 100% consistency in order to narrow how exactly how it happens so you at least know where to start. I would recommend starting here if the above advice doesn’t present an obvious issue to you.

Red
 

Alpha

Relentless
Premium User
Joined
Apr 3, 2011
Messages
651
Solutions
36
Reaction score
448
Location
South Korea
Hi, thanks for answer me

This is the only file I have onKill of legendary


local pokemons = {"Registeel", "Regirock", "Regice", "Mega Diancie", "Deoxys Attack", "Deoxys Defense", "Deoxys Speed", "Deoxys", "Yveltal", "Meloetta Pirouette", "Primal Kyogre", "Victini", "Primal Groudon", "Mega Rayquaza", "Lunala", "Solgaleo", "Hoopa Confined", "Hoopa Unbound", "Thundurus Therian", "Tornadus Therian", "Landorus Therian", "Diancie", "Kyurem White", "Kyurem Black", "Raikou", "Entei","Suicune","Zapdos", "Moltres", "Articuno","Mewtwo","Mew","Lugia","Ho-oh","Celebi","Latios","Latias","Phione","Manaphy","Uxie","Mesprit","Azelf","Arceus","Cresselia","Meloetta Aria","Keldeo","Genesect","Shaymin","Deoxys Normal","Jirachi","Darkrai","Kyogre","Heatran","Rayquaza","Groudon","Dialga","Palkia","Giratina","Tornadus Incarnate","Thundurus Incarnate","Landorus Incarnate","Kyurem","Zygarde 50","Zygarde 10"}


function onKill(cid, target, lastHit)
if isInArray(pokemons,getCreatureName(target)) then
doBroadcastMessage("O jogador "..getCreatureName(cid).." matou o Pokemon Lendario "..getCreatureName(target).."!")
end
return true


end
Here's an optimized version, although this script may not be the issue

Lua:
local pokemons = {
    ["Registeel"] = true,
    ["Regirock"] = true,
    ["Regice"] = true,
    ["Mega Diancie"] = true,
    ["Deoxys Attack"] = true,
    ["Deoxys Defense"] = true,
    ["Deoxys Speed"] = true,
    ["Deoxys"] = true,
    ["Yveltal"] = true,
    ["Meloetta Pirouette"] = true,
    ["Primal Kyogre"] = true,
    ["Victini"] = true,
    ["Primal Groudon"] = true,
    ["Mega Rayquaza"] = true,
    ["Lunala"] = true,
    ["Solgaleo"] = true,
    ["Hoopa Confined"] = true,
    ["Hoopa Unbound"] = true,
    ["Thundurus Therian"] = true,
    ["Tornadus Therian"] = true,
    ["Landorus Therian"] = true,
    ["Diancie"] = true,
    ["Kyurem White"] = true,
    ["Kyurem Black"] = true,
    ["Raikou"] = true,
    ["Entei"] = true,
    ["Suicune"] = true,
    ["Zapdos"] = true,
    ["Moltres"] = true,
    ["Articuno"] = true,
    ["Mewtwo"] = true,
    ["Mew"] = true,
    ["Lugia"] = true,
    ["Ho-oh"] = true,
    ["Celebi"] = true,
    ["Latios"] = true,
    ["Latias"] = true,
    ["Phione"] = true,
    ["Manaphy"] = true,
    ["Uxie"] = true,
    ["Mesprit"] = true,
    ["Azelf"] = true,
    ["Arceus"] = true,
    ["Cresselia"] = true,
    ["Meloetta Aria"] = true,
    ["Keldeo"] = true,
    ["Genesect"] = true,
    ["Shaymin"] = true,
    ["Deoxys Normal"] = true,
    ["Jirachi"] = true,
    ["Darkrai"] = true,
    ["Kyogre"] = true,
    ["Heatran"] = true,
    ["Rayquaza"] = true,
    ["Groudon"] = true,
    ["Dialga"] = true,
    ["Palkia"] = true,
    ["Giratina"] = true,
    ["Tornadus Incarnate"] = true,
    ["Thundurus Incarnate"] = true,
    ["Landorus Incarnate"] = true,
    ["Kyurem"] = true,
    ["Zygarde 50"] = true,
    ["Zygarde 10"] = true,
}

function onKill(cid, target, lastHit)
    local targetName = getCreatureName(target)
    if not pokemons[targetName] then
        return true
    end

    doBroadcastMessage(("O jogador %s matou o Pokemon Lendario %s!"):format(getCreatureName(cid), targetName))
    return true
end
 
OP
OP
R

RadkeShady

New Member
Joined
Aug 1, 2021
Messages
5
Reaction score
0
The code that you posted does not seem complex. You should also check functions that execute in onDeath/onPrepareDeath for creatures as onKill is simply one method that can be used.

However, you mentioned that the issue appears to happen when you’re attacking a Pokémon with high stats. This would likely be from an onStatsChange function or any function that executes each time a Pokemon is attacked.

Ideally you would be able to produce this with 100% consistency in order to narrow how exactly how it happens so you at least know where to start. I would recommend starting here if the above advice doesn’t present an obvious issue to you.

Red
the problem is I don't know how to find the file that might be causing this.

Do you want me to send you file with onStatsChange from my server?
have only one. the name is "exp2.0"


I don't know if you can put the hastebin link here, so i can't put the code here cause exceeds 2000 characters.
Post automatically merged:

Here's an optimized version, although this script may not be the issue

Lua:
local pokemons = {
    ["Registeel"] = true,
    ["Regirock"] = true,
    ["Regice"] = true,
    ["Mega Diancie"] = true,
    ["Deoxys Attack"] = true,
    ["Deoxys Defense"] = true,
    ["Deoxys Speed"] = true,
    ["Deoxys"] = true,
    ["Yveltal"] = true,
    ["Meloetta Pirouette"] = true,
    ["Primal Kyogre"] = true,
    ["Victini"] = true,
    ["Primal Groudon"] = true,
    ["Mega Rayquaza"] = true,
    ["Lunala"] = true,
    ["Solgaleo"] = true,
    ["Hoopa Confined"] = true,
    ["Hoopa Unbound"] = true,
    ["Thundurus Therian"] = true,
    ["Tornadus Therian"] = true,
    ["Landorus Therian"] = true,
    ["Diancie"] = true,
    ["Kyurem White"] = true,
    ["Kyurem Black"] = true,
    ["Raikou"] = true,
    ["Entei"] = true,
    ["Suicune"] = true,
    ["Zapdos"] = true,
    ["Moltres"] = true,
    ["Articuno"] = true,
    ["Mewtwo"] = true,
    ["Mew"] = true,
    ["Lugia"] = true,
    ["Ho-oh"] = true,
    ["Celebi"] = true,
    ["Latios"] = true,
    ["Latias"] = true,
    ["Phione"] = true,
    ["Manaphy"] = true,
    ["Uxie"] = true,
    ["Mesprit"] = true,
    ["Azelf"] = true,
    ["Arceus"] = true,
    ["Cresselia"] = true,
    ["Meloetta Aria"] = true,
    ["Keldeo"] = true,
    ["Genesect"] = true,
    ["Shaymin"] = true,
    ["Deoxys Normal"] = true,
    ["Jirachi"] = true,
    ["Darkrai"] = true,
    ["Kyogre"] = true,
    ["Heatran"] = true,
    ["Rayquaza"] = true,
    ["Groudon"] = true,
    ["Dialga"] = true,
    ["Palkia"] = true,
    ["Giratina"] = true,
    ["Tornadus Incarnate"] = true,
    ["Thundurus Incarnate"] = true,
    ["Landorus Incarnate"] = true,
    ["Kyurem"] = true,
    ["Zygarde 50"] = true,
    ["Zygarde 10"] = true,
}

function onKill(cid, target, lastHit)
    local targetName = getCreatureName(target)
    if not pokemons[targetName] then
        return true
    end

    doBroadcastMessage(("O jogador %s matou o Pokemon Lendario %s!"):format(getCreatureName(cid), targetName))
    return true
end
I don't think that's the problem, but I will use ur code, thanks!
 
Top