local IDN = script.Parent.Parent.TextBox
IDN.FocusLost:Connect(function(enterPressed)
if enterPressed then
Sound.SoundId = "rbxassetid://"..IDN.Text
Sound:Play()
end
end)
Try something like this. You can do some extra checks as you read a new sound value to make sure that it is valid (possibly by converting to number).
Refer to Operatik’s response. The script is running on the server and won’t be able to detect the value of IDN changing because it does not replicate across Roblox’s client-server boundaries.
Oops, you are correct. I missed that this was a ServerScript. If this is something that needs to be played only on the client-side, I’d recommend swapping out the script for a LocalScript.