Out of local registers

Out of local registers when trying to allocate HKTZ_fake_script: exceeded limit 200



Seems to be a plugin or a script in your game causing that bug because roblox put’s it’s gui in CoreGui and that’s PlayerGui.

image

Can you give more context? You are providing quite limited information.

Okay, I made an interface that is just for me so that I can enter it into Console>Server.
As I made it in StarterGui, I copied and deleted it using Gui2Lua. Now I have this problem after adding new buttons. This didn’t happen before.

Thank you for actually explaining the issue.

This could be due to there being too many elements? It says “exceeded limit” which means that your admin console simply has too many gui objects. A fix to this could be to modify that script? Or just use an alternative way?

How many locally stored variables do you have in that script?

umm




1 Like

but I have this interface :frowning:
i can’t fix it or remove variables
total number of variables was 259… what should I do?

You should just make the entire thing into one Gui and use it like that. You’re out of luck with that way.

image

Exactly. Can’t have more than 200 local variables. Just have the GUI pre-built.

Your script is exceeding the 200 local variable limit, so you can’t register any more variables using “local”. This limit though is per scope, which means you can have 200 variables in one function and 200 in another (IIRC).
Though, you should really look into rewriting your script, I have no idea why you just have so many variables, especially with names that don’t describe what they are at all. You should either be putting them inside functions or do statements rather than in the global scope of your script.

1 Like

Jesus…

Either split your script up into ModuleScripts, create different functions, or just premake your UI (please just premake your UI). You should not have 200 variable declarations in one scope

1 Like

Yeah, so just have it already made. Problem solved? Orrr just have a table with all elements and their properties in a parent-child hierarchy i.e:

local GUIS = {
MainGui = {Properties = {ClassName,Enabled},Children = {}
}

And code it accordingly. But it’s better to have it premade.

use global variables (remove “local”) for one-time use variables, the functional ones that are repeatedly accessed should use local.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.