This one should be easy to figure out. Basically, this script plays the music ID that is inputted to the textbox. The problem is, if the focus is lost and I keep pressing enter the sound keeps restarting. Any help with this?
game:GetService('UserInputService').InputBegan:Connect(function(Input, onGui)
if Input.UserInputType == Enum.UserInputType.Keyboard then
if Input.KeyCode == Enum.KeyCode.Return and textBox.Focused then
local sound = game.Workspace.Sound
sound.SoundId = "rbxassetid://"..textBox.Text
sound:Play()
end end end)
Thanks!

1 comment
Thank you so much! :D