I am making a game and at a certain time a frame appears but i need it to some how appear from a script in serverscriptservice i tried
game.StarterGui.MainGui.Frame.Visible = true
but its not working is there a possible way to do this
Well, don't index StarterGui
while messing woth the properties of GuiObjects
. Now, if you want every player's frame via Server Script, you can do :
1 | for _, player in ipairs (game.Players:GetPlayers()) do -- Starting a for loop as ipairs |
2 | local PlayerGui = player:WaitForChild( "PlayerGui" ) -- The contents of StarterGui gets copied to PlayerGui, which is located inside the player Instance |
3 | local Frame = PlayerGui.ScreenGui.Frame |
4 |
5 | Frame.Visible = false |
6 | end |
The important thing is to get the player's instance from server, if you succeed, you can do anything from server to PlayerGui
.
Lemme know if it helps!