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

Is it possible for the gui to be cloned in startergui and be visible for everyone?

Asked by
raid6n 2196 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

How would it be possible to clone it in playergui and startergui when you click the button?

i want it to be visible for everyone as well

tysm for ur assistance


script.Parent.sh.MouseButton1Click:Connect(function() local guiobject = script.Parent.Parent.Game local guiclone = guiobject:Clone() guiclone.Parent = script.Parent guiclone.Name = “yeet” guiclone.Visible = true guiclone.Visible = false print(“yeet") end)
0
Are you sure you want it in startergui instead of just every players "PlayerGui"? Putting the gui in starter gui means that the players have to respawn to see it. cmgtotalyawesome 1418 — 4y
0
oh raid6n 2196 — 4y
0
every player in playergui then raid6n 2196 — 4y

1 answer

Log in to vote
2
Answered by
ryan32t 306 Moderation Voter
4 years ago

You would have to do it in a Server Script and run it through every player because doing it in a Local Script would only clone it locally. Here would be an example:

-- Server Script --

local button = script.Parent
local gui = button.Parent

button.MouseButton1Click:Connect(function()
    for _,v in pairs(game.Players:GetPlayers()) do
        local clone = button:Clone()
        clone.Position = button.Position + UDim2.new(0,10,0,10)
        clone.Parent = v.PlayerGui[gui.Name]
    end
end)
0
I’ll take a look. raid6n 2196 — 4y
Ad

Answer this question