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

How to access CoreGui from a local script?

Asked by
Miniller 562 Moderation Voter
5 years ago
Edited 5 years ago

So I'm trying to create an anti-cheat script I saw in a game. It would detect if there is a new undetected GUI for a player (e.g a remotespy GUI) so it will ban it. However, whenever I write game.CoreGui, it will just say The current identity (2) cannot Class security check (lacking permission 1). The localscript is in StarterCharacterScripts. I got 2 actually, one has this:

01local plr = game.Players.LocalPlayer
02game.DescendantAdded:Connect(function(d)
03    if (d.Parent==game.CoreGui) then
04        if (d.Name == "SpyScroller") then
05            local http = game:GetService("HttpService")
06    local Data = {
07        ["content"] = plr.Name .. " used a cheat. Cheat: Not game-source local GUI! Probably using remote spy. Banned for 1 week!"
08    }
09 
10    Data = http:JSONEncode(Data)
11    http:PostAsync("mydiscordwebhooklink", Data) --Put the link you saved between the two quotes.
12    plr:Kick("You have been banned for using cheats! Duration: 1 week! Appeal in our discord server, #banappeals")
13        end
14    end
15end)

and one has this:

01local safeguinames = {"admingui"}
02local normalamount = 4 --Don't edit this.
03local plr = game.Players.LocalPlayer
04while wait() do
05    if (#plr.PlayerGui:GetChildren() >= #safeguinames) then
06        --check if it's admingui
07        if (#plr.PlayerGui:GetChildren() == 5 and plr.PlayerGui:FindFirstChild("admingui")==false) then
08            --ban.
09            local http = game:GetService("HttpService")
10            local Data = {
11                ["content"] = plr.Name .. " used a cheat. Cheat: Not game-source local GUI! Probably using remote spy. Banned for 1 week!"
12            }
13 
14            Data = http:JSONEncode(Data)
15 
View all 33 lines...

EDIT: Don't care about the dumb script I have many things to do with it but I want to solve this problem first. So what should I do?

0
Don't rely on local anti exploits. Secure the server. Also, for the question, you don't hiimgoodpack 2009 — 5y
0
So then what am I supposed to do? I saw this on Military Simulator. I don't know how they do it if no one else can..? Miniller 562 — 5y
0
Secure your remote events royaltoe 5144 — 5y
0
If they are able to do something from the client, then thats an issue. Make sure you're stopping anything bad from happening by having checks on the server royaltoe 5144 — 5y
0
I want to secure my remote events so I asked a question. Basically this is the same project but I gave up on GUIs cuz I'm just not able to do this.. But as I wrote that some people are able to detect this, I know that there is a way :( Miniller 562 — 5y

Answer this question