23:58:28.507 - Players.rubene45.PlayerGui.RadioGlobal.Frame.ID.Script:14: attempt to concatenate local 'ID' (a userdata value).
local PonerMusica = game.Workspace.PonerMusicaGlobal local PararMusica = game.Workspace.PararMusicaGlobal local Texto = game.Workspace.PonerMusicaGlobal2 Debug = 0 local function PonerMusicaGlobal() if Debug == 0 then Debug = 1 Audio = Instance.new("Sound") Audio.Name = "Audio" Audio.Parent = game.Workspace Audio.Looped = true local ID = script.Parent Audio.SoundId = "rbxassetid://"..ID Audio:Play() end end local function PararMusicaGlobal(p) if Debug == 1 then Debug = 0 Audio.Looped = false Audio:Stop() end end PararMusica.OnServerEvent:Connect(PararMusicaGlobal) Texto.OnServerEvent:Connect(PonerMusicaGlobal)
By looking at your script i'm guessing that the script's name, that this code is in, is the ID of a sound you want to use. If so the reason it's erroring is because you are trying to concatenate the script with the string, to make this we need to give it the script's name which is a string.
local ID = script.Parent.Name Audio.SoundId = "rbxassetid://"..ID
Result:
local PonerMusica = game.Workspace.PonerMusicaGlobal local PararMusica = game.Workspace.PararMusicaGlobal local Texto = game.Workspace.PonerMusicaGlobal2 Debug = 0 local function PonerMusicaGlobal() if Debug == 0 then Debug = 1 Audio = Instance.new("Sound") Audio.Name = "Audio" Audio.Parent = game.Workspace Audio.Looped = true local ID = script.Parent.Name Audio.SoundId = "rbxassetid://"..ID Audio:Play() end end local function PararMusicaGlobal(p) if Debug == 1 then Debug = 0 Audio.Looped = false Audio:Stop() end end PararMusica.OnServerEvent:Connect(PararMusicaGlobal) Texto.OnServerEvent:Connect(PonerMusicaGlobal)