Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] ScreenGui not cloning in ServerStorage, What am I doing wrong?

I recently just started scripting and I made a inventory, However it was in the way of other things so I put it into the ServerStorage.. I am trying to make it if you were to join the game the Gui clones and parents it into StarterGui so it is there when you join the game. I have been working on it for like 2 hours and no luck, I have looked at a bunch of tutorials, but all of them were not for gui's, heres my code:

local gui = script.Parent

local ClonedGui = gui:Clone() ClonedGui.Parent = game.StarterGui

(The type of script is a normal script)

1 answer

✓ Accepted answer

All instances of StarterGui will be reparented into PlayerGui. (It's a child of a player instance.) All of the Gui will be displayed there as well. Try doing this instead:

local gui = script.Parent

game.Players.PlayerAdded:Connect(function(plr)
	local ClonedGui = gui:Clone()
	ClonedGui.Parent = plr.PlayerGui
end)

Quick question, why did you place your script inside of the Gui?

1 comment

0

Thanks and I just started scripting so I kind of just assumed to put it there lol.

This discussion is preserved as it was. New answers, comments, and votes are closed.