✓ Accepted answer
On line 4, if filtering enabled is set to true, scripts can't access PlayerGui. similarly , scripts can't access ReplicatedStorage when filtering enabled is set to true. In order to fix these problems, you first need to use Remote Events to connect the server with the client. Here's a video that helped me with Remote Events. There are more videos you can find on youtube if needed. Next is a bit more simple. Basically, Scripts can't access ReplicatedStorage and Local Scripts can't access ServerStorage. This is for security reasons. So in order to make the script access the Class Gui, Move it to ServerStorage.
A simpler way of solving. A better way of doing this is to leave the Class Gui in replicated storage and do everything in the script in a local script that's connected to a RemoteEvent. Now I'm sure this is very confusing to you, mostly because I'm not doing the best job at explaining this, but the videos and links should help. Here's one more link about filtering enabled, and when you should use it. Thank ScriptGuider for this one.
Anyways, Good Luck! I hope I helped.
4 comments
Where is the script located?
What kind of script is this and where is it
It is a normal script, and located in Workspace.
On line 4, if filtering enabled is set to true, scripts can't access PlayerGui. similarly , scripts can't access ReplicatedStorage when filtering enabled is set to true.