How to show a cloned GUI?

I’m trying to make a GUI Visible inside a scrolling frame.

I set the Visible property to true and it still doesn’t work, its visible when I set the parent to the button I’m clicking. The clone is showing up under the grid. I have tested it by just inserting UI’s into the scrolling frame and u can see them there. The Local Script for it is under the button I’m clicking outside the ScreenGui I’m cloning it to.

local cost = 50
local module = require(game.ReplicatedStorage:WaitForChild("CrateModule"))
local template = game.StarterGui.Inventory.Storage:WaitForChild("Template")
local grid = game.StarterGui.Inventory.Inv:WaitForChild("Grid")


local function inventory(crate)

	local clone = template:Clone()
	clone.Name = crate.Name
	clone.Visible = true
	clone.Parent = grid
	
end


script.Parent.MouseButton1Click:Connect(function()
	local coinValue = game.Players.LocalPlayer.leaderstats.Coins

	if coinValue.Value >= cost then
		coinValue.Value = coinValue.Value - cost
		local crate = module.Choose()
		inventory(crate)
		print(crate)
	end
end)
1 Like

The problem with this is that everything located in StarerGui becomes transferred to the player to as soon as the player loads in. You would have to put that script as a child of the GUI you would like to clone and make the parent of that clone script.Parent.Parent.Grid

2 Likes

Any UI inside the StarterGui will be replicated (cloned) to the PlayerGui, which is located in the Player object.

Just parent the cloned UI to the PlayerGui.

1 Like

TYSM I learned a lot from this

1 Like

Make sure to set one of the responses to “Solution” if it worked, that way if other people are having the same problem, they can see the answer easily.