23:58:28.507 - Players.rubene45.PlayerGui.RadioGlobal.Frame.ID.Script:14: attempt to concatenate local 'ID' (a userdata value).
01 | local PonerMusica = game.Workspace.PonerMusicaGlobal |
02 | local PararMusica = game.Workspace.PararMusicaGlobal |
03 | local Texto = game.Workspace.PonerMusicaGlobal 2 |
04 | Debug = 0 |
05 |
06 | local function PonerMusicaGlobal() |
07 | if Debug = = 0 then |
08 | Debug = 1 |
09 | Audio = Instance.new( "Sound" ) |
10 | Audio.Name = "Audio" |
11 | Audio.Parent = game.Workspace |
12 | Audio.Looped = true |
13 | local ID = script.Parent |
14 | Audio.SoundId = "rbxassetid://" ..ID |
15 | Audio:Play() |
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.
1 | local ID = script.Parent.Name |
2 | Audio.SoundId = "rbxassetid://" ..ID |
Result:
01 | local PonerMusica = game.Workspace.PonerMusicaGlobal |
02 | local PararMusica = game.Workspace.PararMusicaGlobal |
03 | local Texto = game.Workspace.PonerMusicaGlobal 2 |
04 | Debug = 0 |
05 |
06 | local function PonerMusicaGlobal() |
07 | if Debug = = 0 then |
08 | Debug = 1 |
09 | Audio = Instance.new( "Sound" ) |
10 | Audio.Name = "Audio" |
11 | Audio.Parent = game.Workspace |
12 | Audio.Looped = true |
13 | local ID = script.Parent.Name |
14 | Audio.SoundId = "rbxassetid://" ..ID |
15 | Audio:Play() |