Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I detect a ScreenGUI?

Asked by 4 years ago

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.

0
Could you explain more in detail? Anton00k 2 — 4y
0
Do what? Anton00k 2 — 4y
0
Like if an exploiter did this https://gyazo.com/2c4ad1915dd94e64bb5f5145d07663c6 but instead input a code into their executor HelloNigerian 7 — 4y
0
https://pastebin.com/KAJn2dWi Look at this it might help Anton00k 2 — 4y
View all comments (2 more)
0
But I have no idea how to detect if a player creates a screen gui by a script Anton00k 2 — 4y
0
Oh its fine HelloNigerian 7 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

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.

Ad
Log in to vote
0
Answered by 4 years ago

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)

Answer this question