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

ObjectName No Valid in GUI shop, can anyone solve it?

Asked by 3 years ago

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" 

0
What line does the script error on? Krystal_Kyle 47 — 3y
0
Fix your code block. Dovydas1118 1495 — 3y

Answer this question