So when i try to show a gui like this . in a script in the ServerScriptService
while true do wait(10) for i,v in pairs(game.Players:GetPlayers()) do v.PlayerGui.GUI.Block.Visible = true end end
and after this . it show me this in the output !
17:21:51.288 - GUI is not a valid member of PlayerGui
and by the way the gui is in the playerGui !
You cannot access PlayerGui from ServerScriptService. Here is what you should do instead:
Create a "RemoteEvent" inside of ReplicatedStorage and name it "blockEvent"
You should have a server script with this code:
while wait(10) do --Every 10 seconds game:GetService('ReplicatedStorage'):WaitForChild('blockEvent'):FireAllClients() --Fires everyone's client to set the visiblility to true. end
You should have a local script inside StarterGui with this code:
game:GetService('ReplicatedStorage'):WaitForChild('blockEvent').OnClientEvent:connect(function() -- When the client is fired from that player. script.Parent.GUI.Block.Visible = true --Set the visibility to true. end)
Hope this helps! If you need further help, just comment.