game.Workspace.SoundPart.Sound:Play()
I made a very simple line of code, but I'm having trouble changing the sound ID using player chats, EX: play/(song id)
Could anyone help me with this? I know how to use player chat to change properites of bricks but i dont know how to change the song ID with it. Thanks.
--// Settings local Prefix = ":" --// PlayerAdded game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if string.sub(msg:lower(), 1, 5) == Prefix.."play" then pcall(function() local MusicID = string.sub(msg, 7) if MusicID then game.Workspace.Sound.SoundId = "rbxassetid://"..MusicID game.Workspace.Sound:Play() end end) end end) end)