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

Script isn't getting it's parents childs text button. How do I proceed?

script.Parent.SFrame.place.MouseButton1Click:Connect(function()
	place("Thug", true, false)
end)

Image of tree > https://prnt.sc/10fvwrr

Basically, when you click that button, the place function is supposed to go off. It works perfectly fine normally, but when I try to use "Parent.SFrame.place", it doesn't work.

I'm not entirely sure how to get the script.Parent.SFrame(scrolling frame).place(textbutton)

Anyone know how I should proceed?

1 answer

✓ Accepted answer

Oftentimes, scripts load faster and run before any of their siblings. Referencing these siblings before they have loaded in causes the script to error. This is a super common error and the fix is to simply :WaitForChild().

script.Parent:WaitForChild("SFrame")...

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