TextButton doesn't work in a sound player I made. How could this be fixed?
So basically, this sound player makes itself with a script. When it's done, it makes a textbox that you can put the sound asset id into, and an "Enter" button that will copy it into an audio object then it should play. The problem is that the button doesn't work. From videos I've seen, it seems to work just fine and gets me confused.
Thanks in advance. :)
01 | MusicGUI = Instance.new( "ScreenGui" , game.StarterGui) |
02 | MainFrame = Instance.new( "Frame" , MusicGUI) |
03 | SoundIdBox = Instance.new( "TextBox" , MainFrame) |
04 | TitleLabel = Instance.new( "TextLabel" , MainFrame) |
05 | EnterButton = Instance.new( "TextButton" , MainFrame) |
07 | MusicGUI.Enabled = true |
08 | MusicGUI.Name = "MusicGUI" |
10 | MainFrame.Visible = true |
11 | MainFrame.Name = "MainFrame" |
12 | MainFrame.Position = UDim 2. new( 0.7 , 0 , 0.23 , 0 ) |
13 | MainFrame.Size = UDim 2. new( 0 , 290 , 0 , 275 ) |
14 | MainFrame.Active = true |
15 | MainFrame.BackgroundTransparency = 0.65 |
16 | MainFrame.BackgroundColor 3 = Color 3. new( 0 , 0 , 0 ) |
17 | MainFrame.BorderSizePixel = 3 |
18 | MainFrame.BorderColor 3 = Color 3. new( 255 , 255 , 255 ) |
20 | SoundIdBox.Name = "SoundIdBox" |
21 | SoundIdBox.MultiLine = false |
22 | SoundIdBox.Position = UDim 2. new( 0.125 , 0 , 0.25 , 0 ) |
23 | SoundIdBox.Size = UDim 2. new( 0.75 , 0 , 0.15 , 0 ) |
24 | SoundIdBox.TextScaled = true |
25 | SoundIdBox.BackgroundColor 3 = Color 3. new( 255 , 255 , 255 ) |
26 | SoundIdBox.BackgroundTransparency = 0 |
27 | SoundIdBox.Visible = true |
28 | SoundIdBox.Font = "Arial" |
29 | SoundIdBox.BorderSizePixel = 3 |
30 | SoundIdBox.BorderColor 3 = Color 3. new( 65 , 65 , 65 ) |
31 | SoundIdBox.TextColor 3 = Color 3. new( 0 , 0 , 0 ) |
34 | TitleLabel.BackgroundTransparency = 1 |
35 | TitleLabel.Name = "TitleLabel" |
36 | TitleLabel.Text = "Sound Player" |
37 | TitleLabel.Font = "Code" |
38 | TitleLabel.TextColor 3 = Color 3. new( 0 , 0 , 0 ) |
39 | TitleLabel.Position = UDim 2. new( 0.15 , 0 , 0 , 0 ) |
40 | TitleLabel.Size = UDim 2. new( 0.75 , 0 , 0.175 , 0 ) |
41 | TitleLabel.TextScaled = true |
42 | TitleLabel.TextColor 3 = Color 3. new( 255 , 255 , 255 ) |
43 | TitleLabel.Active = true |
45 | EnterButton.Name = "EnterButton" |
46 | EnterButton.Text = "Enter" |
47 | EnterButton.BackgroundTransparency = 0 |
48 | EnterButton.BackgroundColor 3 = Color 3. new( 5 , 5 , 5 ) |
49 | EnterButton.BorderSizePixel = 2 |
50 | EnterButton.BorderColor 3 = Color 3. new( 255 , 255 , 255 ) |
51 | EnterButton.Position = UDim 2. new( 0.78 , 0 , 0.43 , 0 ) |
52 | EnterButton.Size = UDim 2. new( 0.1 , 0 , 0.075 , 0 ) |
53 | EnterButton.Font = "ArialBold" |
54 | EnterButton.TextScaled = true |
55 | EnterButton.Active = true |
59 | local audio = Instance.new( "Sound" , game.Workspace) |
63 | EnterButton.MouseButton 1 Click:connect( function (onClick) |
:)