Help! / ui problem


Hello! My Ui is not working anymore. Here are some errors! I click in it does not open the ui frames!


Here the script! I hope you can help me fix it or fix it!

then so on
Please help me!

You can see in the console that your error is on line 56. Would you mind screenshotting/copy pasting line 56 of your code?

Is this a local script?

One thing about these objects is that they may not exist when you first reference them. It takes some time to download from the server, hence your most likely issue.

Simply use the :WaitForChild() method when trying to access any child objects of your guis. For example:

local Buttons = MainUI:WaitForChild("Buttons")
local CodesButton = Buttons:WaitForChild("CodesButton"):WaitForChild("Frame"):WaitForChild("ImageButton")
--- etc

EDIT: In your case, you have a LOT of objects you’ll need to do it. You could potentially make a function to help you out:

function WaitForDescendant(parent, ...)
    local obj = parent
    for _,v in pairs({...}) do
        obj = obj:WaitForChild(v)
    end
    return obj
end

local CodesButton = WaitForDescendant(Buttons, "CodesButton", "Frame", "ImageButton")

1 Like

yes a local script
edededfrefefefefr

works thanks
e
e
de
ddcfedfefededwe