So basically I'm making a Filtering Enabled radio thats a weld on the players back. The radio inserts in the the players Character, inside of the radio is a Gui that has the input, play song button etc. you insert the song id into an on-screen gui.
Here's the code in the Gui.
local remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
local userInputService = game:GetService("UserInputService")
local frame = script.Parent:WaitForChild("Frame")
local player = script.Parent.Parent.Parent
frame:WaitForChild("Play").MouseButton1Click:connect(function(frame, player)
print("Playing song")
remotes.PlaySong:InvokeServer()
end)
frame:WaitForChild("Stop").MouseButton1Click:connect(function()
print("Stopping song")
remotes.StopSong:InvokeServer()
end)
And here is the code inside of the ServerScript which plays the song etc.
local remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
sound = Instance.new("Sound")
sound.Volume=1
sound.Pitch=1
sound.Name=""
sound.Looped=true
sound.PlayOnRemove=false
local Format = "http://www.roblox.com/asset/?id=##ID##"
remotes.PlaySong.OnServerInvoke = function(frame, player)
local input = tonumber(frame:WaitForChild("Input").Text)
if input then
sound:Stop()
sound.SoundId=Format:gsub("##ID##", tostring(input))
sound:Play()
sound.EmitterSize = 0.5
sound.Parent = player.Radio
end
end
The issue I'm having is whenever I click play song I get Infinite yield possible on 'Players.gage7252002:WaitForChild("Input")
The script does not execute pas the if input then part. No clue why this is happening, can anyone help?

2 comments
Thank you, this worked, but then I get a "Radio is not a valid member of Player" error. I have a feeling I know what this is from but I don't know how to get the players character in Workspace. :(
Nevermind got it working!!! Thank you so much, have been trying to figure this out for days. :D