Why isn't this code more efficient?

I’m pretty sure you can just do this with string manipulations?

StrRepeat("0",(6 - StrLength(GlobalVariableString(Score)))) + GlobalVariableString(Score)

This basically says "Add 0s to the front of GlobalVariableString(Score) based on how many characters less than 6 the score is.

So you’d have 1 event of “Score < 100000” | Change the text of Score: set to (above expression)

Then you’d have one of “Score >= 100000” | Change the text of Score: Set to GlobalVariableString(Score)

Also, the events you tried to make more efficient will conflict and bog down your game. If your score is 1, it is <100000 and <10000 and < 1000

So your events are constantly fighting each other.

2 Likes