Also, your code confuses me. First you declare HudLevelValue as a HUDElem (fontstring) and then you try to change the alpha by accessing it like an array? wtf.
It should look like this:
Code:
HudLevelValue.alpha = 1; //Kinda useless anyway, a HUDElem has an alpha of 1 by default
At the start of your code you had this:
I'm assuming that the current value of self.pers["LVL"] at that point is 1.
Code:
HudLevelName[self.pers["LVL"]] = self createFontString( "objective", 3 );
so really, it's this:
Code:
HudLevelName[1] = self createFontString( "objective", 3 );
Then you try to execute this.
Code:
HudLevelName[self.pers["LVL"]-1] delete();
which really is this:
Code:
HudLevelName[0] delete();
The reason it probably has a lag spike is because HudLevelName[0] is never declared.... Bad usage of arrays is bad. I don't even see where self.pers["LVL"] is incremented or anything...
Also this:
Code:
if(isDefined(HudLevelName[self.pers["LVL"+1]])) //Bad syntax, probably will try to access self.pers["LVL1"]
----
If you could let me see the mod I could probably help but otherwise there's not enough code there to give an accurate fix.