so I need to get the total amount of GUIs in CoreGui for a normal instance, as far as I know roblox deletes and creates GUIs instead of making them invisible and that makes my program unstable causing it to kick innocent clients for no reason.
tl;dr is there a way to get the maximum amount of CoreGui object that you can have at once in a normal roblox instance?
(it doesn’t has to be a LocalScript, feel free to use roblox studio to retrieve a value)
The maximum number of objects in the CoreGui aren’t guaranteed (Roblox could just… update the CoreGui and make your game kick everyone) and can’t be found. You shouldn’t be relying on this unsafe and frankly terrible idea of finding exploiters because of the high chance of false-positives.
You will never know; When a new player joins; a new label is created,
When a new setting is implemented, a new system even a whole new level of gui’s are defined.
Players changing their character emotes, players opining new pages in the core gui.
Each new output to the dev console, is a new element… And well thats impossible to know the number off, because of core script errors; and so on more.
In other words, there isn’t a defined amount. And there will probably never be
is there atleast track it in-game with a LocalScript? like whenever a new element is added the game simply increases the value and whenever the element is removed it decreases the value.
im not the one whoose making the anticheat here, this post were requested by a friend. if I were making an anticheat I would mostly prefer serverside checks.
Roblox uses Roact, which updates the amount of instances dynamically. Additionally, as other people have pointed out, an update could make this value incorrect.
Besides, if you’re trying to make an anti-cheat the real solution is securing your game on the server.