I’m trying to make a shop gui system. I keep getting an error saying 16:25:47.654 - EQUIP is not a valid member of Frame. I checked an EQUIP is under the Frame.
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("ScreenGui")
script.Parent.MouseButton1Click:Connect(function()
for _, v in pairs (gui.Shop.Stats.Frame:GetChildren()) do
if v:IsA("GuiBase") then
v.Visible = false
end
end
gui.Shop.Stats.Frame.LongStick.Visible = true
if gui.Shop.Stats.Frame.LongStick.Owned == true then
gui.Shop.Stats.Frame.LongStick.Buy = false
else
gui.Shop.Stats.Frame.LongStick.EQUIP = false
end
end)
It might be because the EQUIP is not the child of the frame. Sometimes when i add new GUI into my frame it does not become the child of it, becomes the child of the ScreenGui.
I know that it will return nil if it doesn’t exist. That’s why i suggested to print it. WaitForChild() makes the script assume that the child will exist in a few seconds or less.
The line right here is throwing an error because you are forgetting the property at the end to change to false. Declaring a UI object “false” can lead to errors!
This line right here, you’re ending it off with “EQUIP” as false. As “EQUIP” is a UI object, and not a property, it’s going to throw an error, which is what I believe is happening right now. What did you intend to to do with this line of code?