Hey guys, I'm running into an issue where I want to copy a gui into a player. I have filtering enabled on, and it does not work. But it does work with filtering enabled off.
The following code is in a serverscript:
game.Workspace.FilteringEnabled = false game.ReplicatedStorage.PrisonTimeRemaining:Clone().Parent = player.PlayerGui game.Workspace.FilteringEnabled = true
That is my really sketchy, hacky idea of a workaround. No idea if it works. Is there a better way to do this?
I assume it would have to be done using remote events, but I have no idea how to tackle this logically.
Thanks!
You're trying to change the FilteringEnabled Property in game and Clone objects to PlayerGui with a server script.
The FilteringEnabled property is not able to be enabled or disabled in game. The reason for this is for security and compatibility measures, security being the exploitability of the game while compatibility continues to ensure the game is functioning properly.
What FilteringEnabled does is stops the client from making changes to the server, as well as the server from making changes to complete client oriented objects such as the PlayerGui. With this said, your script would not work in a Server Script since the server is acting to clone an object into PlayerGui. To fix this problem, you simply just have to use a LocalScript.
In order to have the client communicate to the server, or vice versa, I would recommend you look into RemoteEvents and RemoteFunctions.
game.ReplicatedStorage.PrisonTimeRemaining:Clone().Parent = player.PlayerGui