I have a ScreenGui object that needs to be given only to administrative players. It must not be replicated to non-administrative players at all. In my game I have FilteringEnabled set to true. When FilteringEnabled is true, a Player's PlayerGui will not replicate to the server. This means that the following code in a server Script will not work because the PlayerGui is not accessible to it.
game.Players.PlayerAdded:connect(function(p) if playerIsAdmin(player) then --The line below does not work because PlayerGui is not accessible -- to this script running on the server. game.ServerStorage.AdminScreenGui:clone().Parent = player.PlayerGui end end
How can I replicate this ScreenGui object to administrative players only without replicating it to all players while keeping the FilteringEnabled property set to true?