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

How would I make a server script put a gui and frame into all players player gui?

Asked by 4 years ago

I put a script in serverscriptservice, that is only putting the gui and frame in that players player gui, that the event fired from. Do I need to change it, or use something else? Code:

local remote = game.ReplicatedStorage.OpenEvent
remote.OnServerEvent:Connect(function(player)
player.PlayerGui:WaitForChild("CreatingLobbyGui")
local LobbyCopy = game.Lighting.LobbyGui:Clone()
LobbyCopy.Parent = player.PlayerGui
local LobbysCopy = game.Lighting.Frame:Clone()
LobbysCopy.Parent = player.PlayerGui.ActiveLobbys.Frame.Frame

end)
0
I also might be afk for a bit. zandefear4 90 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Guy that removed his wont work.

local remote = game.ReplicatedStorage.OpenEvent
remote.OnServerEvent:Connect(function() --Client sending request to server to show all guis

    for i, v in pairs(game.Players:GetPlayers()) do
        local LobbyCopy = game.Lighting.LobbyGui:Clone()
        LobbyCopy.Parent = v.PlayerGui
        local LobbysCopy = game.Lighting.Frame:Clone()
        LobbysCopy.Parent = v.PlayerGui.ActiveLobbys.Frame.Frame
    end
end)
0
Thanks, thats working. zandefear4 90 — 4y
0
I've been looking for something like this for a while zandefear4 90 — 4y
0
Also, you should say guy below now, lol. zandefear4 90 — 4y
Ad

Answer this question