Hello guys, So I am trying to do something like this
script.Parent.GetButtonRemoteEvent.OnServerEvent:Connect(function(plr, test) local gui = game.Lighting.Folder.TestButton:Clone() gui.Parent = plr.PlayerGui.TestFrames.Frame.ScrollingFrame gui.Test.Value = true end)
It says "TestFrames is not a valid member of PlayerGui" when it actually is. It is in PlayerGui but for some reason it can't find it.
Please, help
You are trying to access the ScreenGui
from a server script. ScreenGui
s cloned from StarterGui
to PlayerGui
are not replicated to the server, therefor you cannot use them from a server script.
You need to either use RemoteEvents
to tell the client when to modify the gui or clone the gui from a server script into the PlayerGui
, then it will be accessible by server, although it's a less recommended way.
(Note this answer is a copy/paste of my other answer, because I've already typed the same thing at least 4 times this week and I have no idea how to reword it anymore to make it not look the same xd)