Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Textbox text error with radio script?

This is the error for my radio

****18:10:57.458 - Sound Workspace.Odawg566.UpperTorso.Sound Failed to load ****rbxassetid://Enter ID Here

The textbox's starting text is Enter ID Here, but when I add a music Id it wont change to the new id, instead it picks up the textbox's old text "Enter ID Here".

It's been bothering me for a while, some help would be nice.

local PlayButton = script.Parent:WaitForChild("Play")
local StopButton = script.Parent:WaitForChild("Stop")
local ID = script.Parent:WaitForChild("Id")
local event = script.Parent:WaitForChild("PlayMusic")
local event1 = script.Parent:WaitForChild("StopMusic")

wait(1)	
event.OnServerEvent:connect(function(plr)
   if plr.Character.UpperTorso:FindFirstChild("Sound") then
        print("Has Sound")
    else
        local effect = script:WaitForChild("Beats"):Clone()
        effect.Parent = plr.Character.UpperTorso
	 local sound = Instance.new("Sound", plr.Character.UpperTorso)
	 print("Giving Sound")
 	 sound.SoundId = "rbxassetid://"..ID.Text 
    sound.Looped = true
    sound.Archivable = true
    sound.MaxDistance = 50
    sound.EmitterSize = 10
    sound.Volume = 3
    sound.Playing = true
end
end)

event1.OnServerEvent:connect(function(plr)
	
    if plr.Character.UpperTorso:FindFirstChild("Sound") then
        plr.Character.UpperTorso.Beats:Destroy()
        plr.Character.UpperTorso.Sound:Destroy()
    else
        print("No Sound Found")
    end
end)

1 answer

You should try messing around with the textbox, because there could be a lot of reason, you can add wait()

2 comments

0

I tried to add a wait but even with a wait it wont load the new text.

0

Maybe you should try adding another StringValue and set that value to the text in the TextBox, and then add that value to the SoundId, That's how you do it indirectly and I believe it should work, this happened to me once

This discussion is preserved as it was. New answers, comments, and votes are closed.