well im trying make a Shop GUI from youtube channel call "AlvinBlox" i see the tutorial and i copied (Not most of all just a fundamental) but yeah when i script there's an error and i don't how to solved it here's the code:

in the Tools child:

  1. ClassicSword

local folder = game.ReplicatedStorage:WaitForChild("Tools")

local frame = script.Parent:WaitForChild("ShopLeft")

local template = frame:WaitForChild("Template")

for _, tool in pairs(folder:GetChildren()) do local newTemplate = template:Clone() newTemplate.Name = tool.Name newTemplate.ObjectName = tool.Name newTemplate.Visible = true newTemplate.Parent = frame

-- event when you clicked it

newTemplate.MouseButton1Click:Connect(function()
	local Result = game.ReplicatedStorage.BuyItem:InvokeServer(tool.Name)
end)

end

output:

ObjectName is not a valid member of Frame "ClassicSword" 

2 comments

0

What line does the script error on?

0

Fix your code block.