Inserting GUI in Scrolling Frame isn't visible

Currently I have a script that whenever you click a button it will insert a gui into a scrolling frame. In explorer I have selected the gui in the scrolling frame and the script works, but the gui isn’t visible on the scrolling frame.

1 Like

What is your script inserting into your scrolling frame?

local PurchaseGUI = script.Parent
local CaseButton = PurchaseGUI.CaseButton
local player = game.Players.LocalPlayer
local leader = player:WaitForChild("leaderstats")
local money = leader:WaitForChild("Money")

CaseButton.MouseButton1Click:Connect(function()
	if money.Value > 21.11 or money.Value == 21.11 then
		money.Value -= 21.11
		money.Value = math.floor(money.Value * 100 + 0.5) / 100
		game.ReplicatedStorage.ChromaCase.idk:Clone().Parent = game.StarterGui.Inventory.ScrollingFrame
	end
end)

You should be parenting it to player.PlayerGui not StarterGui

local PurchaseGUI = script.Parent
local CaseButton = PurchaseGUI.CaseButton
local player = game.Players.LocalPlayer
local leader = player:WaitForChild("leaderstats")
local money = leader:WaitForChild("Money")

CaseButton.MouseButton1Click:Connect(function()
	if money.Value >= 21.11 then
		money.Value -= 21.11
		money.Value = math.floor(money.Value * 100 + 0.5) / 100
		
		game.ReplicatedStorage.ChromaCase.idk:Clone().Parent = game.Players.LocalPlayer.PlayerGui:WaitForChild("Inventory"):WaitForChild("ScrollingFrame")
	end
end)

As well you should be removing money on the server you could use a remote event for this.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.