Frame not valid member

probably has been asked a lot but I can’t seem to find answer…

Screen Shot 2020-09-14 at 10.03.21 PM

I am trying to link Button1 to make TrailFrame Visible inside but which works for other buttons for some reason even if I give the script the exact place it still shoots error “frame is not valid part of image button” even if im Parent.Parent.Parent away…

my script so far

local toggle = script.Parent

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

toggle.MouseButton1Click:Connect(function()

frame.Visible = true

end)

In ur image I dont see TrailFrame being a child of the Button1, thats what the error is saying, isnt?

yea, that’s what I’m trying to figure out why when I parent.parent to leave the button1 and reference the correct frame it keeps taking me back and saying i’m trying to reference TrailFrame

looks weird…
Try to Print(frame) and frame.ClassName to see what u got into that variable

what do you mean frame.ClassName?

without the
local frame = script.Parent.Parent:WaitForChild(“TrailFrame”)
print works just fine

wait(5)
local frame = script.Parent.Parent:WaitForChild("TrailFrame")
print("We have this in frame: ", frame)
print("Frame is a: ", frame.ClassName)

The idea is just to see if it get nil. It’s just simple debbuging

1 Like

I just get infinite yield on the wait for child

very weird… Means that is impossible to find that object in ur GUI…

Maybe its trying to check the existance of the Frame, while the player is loading? So the frame is not created yet.
You used the wait(5) just to be sure its not about delay?

yeah. I was spamming the button with no errors and after the 5 seconds my output started flooding with InFinIte YieLds.

the weird thing is when I play test, all of the scrolling frames Trails-Gamepass are not showing up in PlayerGui… while everything else is.

could they be glitched?? even when I make them visible the frames still don’t pop up on test play

When u use the Test, only the Server is created, the player is not, so the starterGui never run

confused cause everything else in shop loads in playergui

Well, I dont know all the mechanics that occurs when you use Test, but it would be better if u make ur player’s GUI tests, using Play instead of Test, just to be sure a player is loading in the server

you mean make a private game and join it right

I just mean, in studio, hit the Play button and not the Test one.

My mistake… the name of the button was Run not Test… :v

aren’t they the same? by play I meant the little robloxian in front of the play button top left

Yup, that Play button. F5 shortcut.

Well, if the problem is not about the delay between joining player and the order that the GUI is created, should be another thing.

Could you try, to place a new script, as a child of the Shop? and instance the frame and print from that script. Just debbuging

Is your frame Archivable? if not nothing can find it.

2 Likes