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

How do I clone a GUI with a script and make it's parent "StarterGui"?

I want to make a Shop, and how I want it to be like is "If touching block clone script.parent.shopgui", with it's parent being StarterGui, making the shop appear. If you have any other ways, it's totally fine.

This is what i have:

script.parent.Touched:Connect(function()
	-- SCRIPT GOES HERE!!
end)

P.S. I don't need a "TouchEnded" line

1 answer

It's been forever, and First: I don't need to know the answer. Second: You're not supposed to put it in StarterGui, Instead Put it in Player-->PlayerGui Third:

script.Parent.Touched:Connect(function(Part)
	local Player = Part.Parent
	if game.Players:GetPlayerFromCharacter(Player) then
		script.Parent.shopgui.Parent = Player.PlayerGui
	end
end)

I didn't clone it, Instead I Changed It's Parent. Too bad I didn't have the shop for you to see...

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