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

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

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

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

if gui:IsA("BillboardGui") then

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

1 comment

0

That didn't solve anything....

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.

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