Hi so I am getting this error "The current identity (2) cannot Class security check (lacking permission 1) "
Now I know this is an error you get when a script usually doesn’t have the permission on check something like core gui for example but that is not what I am doing here is my script:
game.DescendantAdded:Connect(function(descendant)
if descendant:IsA("ScreenGui") then -- this is the line thats erroring
I don’t understand what I don’t have permission to do? Please let me know, thanks.
This is probably because you’re using a method on a locked object (such as one in CoreGui). DescendantAdded will still fire for locked objects although you can’t access them
Im not using it on core gui Im just using it on game.DescendantAdded:Connect(function(descendant) so the game, but thats not what errors it’s cheking ifs a gui that errors
game.DescendantAdded will fire for all objects added anywhere to the game, CoreGui, workspace, Players, etc… What’s your use case? There’s most likely a better solution to what you’re trying to do
I want it to fire for plr gui and core gui but if I say
game.CoreGui then it will stop working right off the bat so I want to be able for it to fire for core gui and player gui, I did access core gui the same way before I don’t know why it won’t work now.
Roblox doesn’t want developers to be able to access the coregui so they always patch all kinds of methods that people come up with. IIRC, you used to be able to tostring() the instances added to CoreGui before to see their names but they made it so any kind of access to coregui elements throws that error