Detecting if a Gui is enabled for all players server-sided?

Curious of me, i was wondering if it is possible to detect if a (or all) players has a certain gui enabled in their Player.Name > StarterGui, i am doing this to prevent abuse of a purchase event. and make it only OnServerEvent function if the gui is enabled.
I could also check if gui is enabled before firing, but the script is a local and you know…Don’t trust the client they say.

The only way you can do that is if you enable/disable the gui from the server rather than from the client, though typically the client should be in charge of that. There are probably other ways you can prevent abusing the purchase event, though that depends on how the purchase event works

The purchase event is pretty generic, Client fires server event through replicated storage.
Server picks it up through onserverevent and gives the player the tool they purchased.
The problem with this exploiters can easily FireServer() without even having the gui open which could lead to many problems.

I think in that case, since the gui acts as a hub where you can click to buy tools from what I’m assuming, I think it woudl be a good choice to check if they have enough money before going through with the purchase first rather than check if a gui is enabled

That should be a good 2nd check as well if the only way the shop gui can be shown is if they’re near the shop, those should be enough to stop simple abuse

1 Like

I could try your suggestion, i’ll also try using a position check to see if player is near the shop area on the OnServerEvent before cloning the tool to player backpack.