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

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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...

Ad

Answer this question