Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

is there a way to make a frame visible from a script in serverscriptservice?

Asked by
sameb556 -12
3 years ago

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

1 answer

Log in to vote
0
Answered by 3 years ago

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 :

for _, player in ipairs(game.Players:GetPlayers()) do -- Starting a for loop as ipairs
    local PlayerGui = player:WaitForChild("PlayerGui") -- The contents of StarterGui gets copied to PlayerGui, which is located inside the player Instance
    local Frame = PlayerGui.ScreenGui.Frame

    Frame.Visible = false
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!

0
but how do i put this in my script sameb556 -12 — 3y
0
Well, you have not included your script, you can put it at the part when you want it to fire. BestCreativeBoy 1395 — 3y
Ad

Answer this question