Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

"BuyETC is not a valid member of Frame"??

I have made a Shop GUI, and I have encountered an error. It is very strange. The Speed Coil button throws an error, but the RPG one works just fine. The error comes as, "BuyETC is not a valid member of Frame". It IS a valid member of the frame. As I said, the other one works just fine. The code for the coil is:

local img = "rbxassetid://99170415"
local selection = script.Parent.Parent.BuyETC.Selection
local price = script.Parent.Parent.BuyETC.Price

script.Parent.MouseButton1Click:connect(function()
	selection.Image = img
	price.Text = "Price: 1000"
end)

And the code for the RPG (The one that works fine) is:

local img = "rbxassetid://1960322961"
local selection = script.Parent.Parent.BuyETC.Selection
local price = script.Parent.Parent.BuyETC.Price

script.Parent.MouseButton1Click:connect(function()
	selection.Image = img
	price.Text = "Price: 5000"
end)

Help would be appreciated.

2 comments

0

That's what happens when you don't use :WaitForChild(''), if that still gives an error you might want to check if it really exists

0

It DOES really exist. That's why the RPG one works.

1 answer

Solved using :WaitForChild(). Thanks, @RedcommanderV2

This discussion is preserved as it was. New answers, comments, and votes are closed.