I'm working on a Command which plays music globally and Roblox keeps outputting this following output.
ServerScriptService.EventFunctions:72: attempt to concatenate local 'AudioId' (a userdata value)
the code is as follows:
On Server Script
--// Local Variables
local PlayMusicEvent = game:GetService("ReplicatedStorage"):WaitForChild("PlayMusic")
--// OnServerEvent
PlayMusicEvent.OnServerEvent:Connect(function(AudioId)
local S = Instance.new("Sound")
S.Playing = true
S.Volume = 1
S.SoundId = "rbxassetid://" .. AudioId
S.Name = "AddedMusic"
S.Parent = game.Workspace
end)
On Client LocalScript
--// Local Variables
local Event = game:GetService("ReplicatedStorage"):WaitForChild("PlayMusic")
local AudioIDField = script.Parent.Parent.MusicIdFieldFrame.MusicIdField
--// FireServer
game.ReplicatedStorage.PlayMusic:FireServer(AudioIDField.Text)
I haven't a clue why it keeps saying that local 'AudioId' is a userdata value whenever the Event is fired is a really straight forward script pass the ID to the server to then create the Sound Object and put the SoundId the user picked. Can anyone else spot why this happens?

3 comments
But I haven't given it a pass through of "Player" only the SoundId I've managed to do it with a Time Event for another command which doesn't give this problem.
Okay I did it and it worked thank you, I find it stupid that in some instances the default 1st is Player and in some it isn't very confusing, now it works now thanks.
Okay