Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I detect a ScreenGUI?

How do I detect a GUI being made in CoreGui, StarterGui and PlayerGui for example if I had an "exploit" and I execute a GUI how would I detect that like this

local screenguii = Instance.new("ScreenGui")
local framee = Instance.new("Frame")

screenguii.Parent = game.CoreGui
framee.Parent = screenguii

How would I make a check if there was a new GUI in CoreGui?

I want to make an anti-cheat so exploiters don't get any sort of an advantage.

6 comments

0

Could you explain more in detail?

0

Do what?

0

Like if an exploiter did this https://gyazo.com/2c4ad1915dd94e64bb5f5145d07663c6 but instead input a code into their executor

0

https://pastebin.com/KAJn2dWi Look at this it might help

0

But I have no idea how to detect if a player creates a screen gui by a script

0

Oh its fine

2 answers

The problem is, they're executing it locally. This means that the server can't pick up on what they added to their client unless you give the information to it first. You should try seeing if any changes have been made locally first, then send the information to the server by using Remote Events or Functions. Then you could try removing them. However, I haven't tried this, but if it was that simple, then why haven't other games used it? They could also try remove the local script. This is why it's almost impossible to stop exploits.

You would listen when a Child has been added into the PlayerGui, and checking whether the Descendant's Name can be found inside StarterGui (I'm sure there are more advanced ways of checking this, but you get the idea):

local LocalPlayer = game:GetService("Players").LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

PlayerGui.ChildAdded:Connect(function(Child)
	if not game:GetService("StarterGui"):FindFirstChild(Child.Name) then
		--possibly adding something on their own
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.