Clicking a TextButton in a BillboardGui won't work?
I'm trying to make it so that if you click the TextButton then it will print "Clicked", but it doesn't work.
Here is the code:
01 | function ToggleGui(Part) |
02 | local a = Instance.new( "BillboardGui" ,Part) |
03 | a.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
04 | a.StudsOffset = Vector 3. new( 0 , 0 , 0 ) |
10 | local s = Instance.new( "TextButton" ,a) |
11 | s.BackgroundColor 3 = BrickColor.new( "Light stone grey" ).Color |
12 | s.BackgroundTransparency = . 7 |
14 | s.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
15 | s.Position = UDim 2. new( 0 , 0 , 0 , 0 ) |
19 | s.TextColor 3 = BrickColor.new( "Institutional white" ).Color |
20 | s.TextStrokeTransparency = 0 |
24 | s.MouseButton 1 Down:connect( function () |
Everything shows up, but the TextButton just wont work. There are no errors in the Output. I've tried using MouseEnter, MouseButton2Down, moving the StudsOffset, moving the GUI into PlayerGui, and changing Sizes and Positions, though it still doesn't work. Is it just that there's something wrong with the Part that I place it in or is there something wrong with the code?