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

Getchildren not a member of Frame?

The error for this script says " GetChildren is not a member of Frame" on line 12, what is wrong with line 12?

local BUTTON = script.Parent
local ITFRAME = BUTTON.Parent.Parent
local FRAME = ITFRAME.Hull
local NAME = BUTTON.Text
local ITEMNAME = FRAME.Itemname
local SCROLLINGFRAME = ITFRAME.ScrollingFrame
FRAME.Visible = false

function on_button1_down()
	
	for I,v in pairs (ITFRAME:Getchilrden()) do --Here is the problem <<<<<<
if v.Name ~=  SCROLLINGFRAME-- item to avoid
then v.Visible = true
else v.Visible = false

	ITEMNAME.Text = NAME
	
	FRAME.Visible = (not FRAME.Visible)
end
	end
	end
BUTTON.MouseButton1Down:connect(on_button1_down)

4 comments

0

GetChildren is the function, not Getchildren.

0

Also, I've already answered your question.

0

Also you spelled GetChildren() wrong, you spelled it as Getchilrden()

0

I said that already?

3 answers

That's a pretty simple problem and can easily be solved with a for _, fr in pairs(TlFrame:GetChildren()) do which will do the stuff inside of this and an end to anything inside of this table.

local BUTTON = script.Parent
local TlFRAME = BUTTON.Parent.Parent
local FRAME = TlFRAME.Arbalest
local NAME = BUTTON.Text
local ITEMNAME = FRAME.Itemname

FRAME.Visible = false

function on_button1_down()
    for _, fr in pairs(TlFrame:GetChildren()) do
        if fr ~= FRAME then -- This will prevent the content of the FRAME variable from being changed.
        fr.Visible = false
        end
    end
    ITEMNAME.Text = NAME
    FRAME.Visible = (not FRAME.Visible)
end

BUTTON.MouseButton1Down:connect(on_button1_down)

If this doesn't help you with your problems or isn't what you needed, simply reply in a comment and I'll see what I can do.

1 comment

0

This works.


local BUTTON = script.Parent
local ITFRAME = BUTTON.Parent.Parent
local FRAME = ITFRAME.SmallHandle 
local NAME = BUTTON.Text
local ITEMNAME = FRAME.Itemname
local SCROLLINGFRAME = ITFRAME.ScrollingFrame

FRAME.Visible = false

function on_button1_down()
    for _, fr in pairs(ITFRAME:GetChildren()) do
        if fr ~= SCROLLINGFRAME then -- This will prevent the content of the FRAME variable from being changed.
        fr.Visible = true
elseif fr ~= FRAME then
		fr.Visible = true
else fr.Visible = false
        end
    end
    ITEMNAME.Text = NAME
end
BUTTON.MouseButton1Down:connect(on_button1_down)

Here is the edited script, It works except it doesn't make all of the other frames that aren't (FRAME) not Visible. I thought else fr.Visible = false would do that because else in this situation would be All of the frames other than SCROLLINGFRAME and FRAME right? But it didn't work

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