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

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

Asked by 5 years ago

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.

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 User#20388 0 — 5y
0
It DOES really exist. That's why the RPG one works. Ultimate_Miner64 45 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Solved using :WaitForChild(). Thanks, @RedcommanderV2

Ad

Answer this question