Music Scripting Help

Greetings,

I am looking to achieve a music system that plays a certain song once I join the game. So people know that I have joined. Everyone inside the game will be able to hear the song as well including myself. I am not sure how to write this code, if someone can send a tutorial or leave the code in the comments that would be much appreciated.

Thank you,
Snoopy

in a Script inside serverscriptservice connect to the Players.PlayerAdded event, check if the player of the event has your UserId and if it does play a sound

game.Players.PlayerAdded:Connect(function(Player)
    if Player.UserId == youruserid then
        sound:Play()
    end
end)

basically

If you scroll down to the feedback sounds portion, you can learn how to play a sound using a script:

Here also is a previous post with some helpful code to find a specific player

Here is script,you need to put sound you want to play into script and give it name Sound then you can change sound id you want:

local sound = script.Sound
game:GetService("Players").PlayerAdded:Connect(function(player)
if player.UserId == 125472773 then --it is your user id, also if UserId don't work try PlayerId,also this numbers is your UserId i just checked it
    sound:Play()
   end
end)

Also i just it was in drafts but i writed it 3 days ago when you just posted :skull: :skull: :skull: