Hello. I am trying to make server music player GUI. The problem is the text box, where a player enters the audio id is not updating. What I mean is, when I press play audio, it tries to play the default text box text that I had set.
eyy = script.Parent.Parent.TextBox.Text script.Parent.MouseButton1Click:connect(function() game.Workspace.Sound.SoundId = ('rbxassetid://'..eyy.Text) game.Workspace.Sound:Play() end)
I get this error "Sound Workspace.Sound Failed to load rbxassetid://Enter Audio ID here"
That is the script I have right now. Please tell me what's wrong with it, and how to fix it.
Thanks
This is happening because, if you set a variable to the text of the textbox, it'll only store the string of that text at that time. Instead, you should do something like this:
eyy = script.Parent.Parent.TextBox script.Parent.MouseButton1Click:connect(function() game.Workspace.Sound.SoundId = ('rbxassetid://'..eyy.Text) game.Workspace.Sound:Play() end)