Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I find every Billboard Gui in the PlayerGui using ClassName? [UNSOLVED]

Asked by 10 years ago

Hey, guys. I am trying to make a script that finds every single Billboard Gui inside a player's PlayerGui using ClassName, and making them enabled when the player presses the 'e' key. I tried the following inside a localscript, inside the StarterPack, but it doesn't seem to be working. If anyone can teach me the answer to this problem, I would gladly appreciate it!

Player = script.Parent.Parent
mouse = Player:GetMouse()

function onKeyDown(key)
key = key:lower()
    if script.Open.Value == false then
        if key == "e" then
            gui = Player.PlayerGui
            for _,  gui in ipairs(part:GetChildren()) do
                 if gui.ClassName == 'BillboardGui' then
                        gui.Enabled = true
                  end
            end
        end
    end 
end


mouse.KeyDown:connect(onKeyDown)

3 answers

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

You never defined 'part' as used in line 9. Also, for the ClassName, I would do

if gui:IsA("BillboardGui") then

Ad
Log in to vote
0
Answered by 10 years ago

The correct ClassName is "BillboardGui" not "Billboard Gui".

0
That didn't solve anything.... dpark19285 375 — 10y
Log in to vote
0
Answered by 10 years ago

Well, if it were to show up, it'll have to be in a block. And it needs a TextButton or TextLabel inside of it.

Answer this question