The Server (which is the game) cannot access the Player's PlayerGui when Filtering Enabled is on or off (I don't really know about that, the off part.) So, I would advise you to use a LocalScript or a RemoteEvent or RemoteFunction to fully access a Player's PlayerGui
For a RemoteFunction, here is what it looks like using your function;
game.ReplicatedStorage.RemoteFunction.OnClientInvoke = function(text)
local player = game.Players.LocalPlayer
player.PlayerGui.Main.Time.Text = text
end
[Note]: Replace RemoteFunction to whatever you have named your RemoteFunction and replaced ReplicatedStorage to whatever was the RemoteFunction's parent is. Also, when using .OnClientInvoke, you do not need a Player argument because the LocalScript can get a Player by doing this; local player = game.Players.LocalPlayer
Now for the RemoteEvent;
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(text)
local player = game.Players.LocalPlayer
player.PlayerGui.Main.Time.Text = text
end)
[Note]: Same note from the RemoteFunction example, but this time, you will need to connect the event, OnClientEvent to make it work properly.
For more information; click here!
Hope this helped!
2 comments
Next time use the Lua icon to format your code correctly.
Can we make it clear? Your display is at your computer so you can see it, not ROBLOX's servers.