I've tried making the script, it didn't work and I eventually deleted it when I realized all the errors. I need help making a script that lets certain music play for everyone when a certain player enters, and if I have other music playing in the background or sound effects, it will mute it and have only that exact audio playing. I've tried several times scripting it, but all have failed and eventually been deleted. Please help ;c
Or To Be Secure Use This:
game.Players.PlayerAdded:connect(function(plr) if plr.name == "Filipalla" and plr.UserId = "65116335" then game.Workspace.(Sound Instance Name):Play() end end)
Insert The Name Of The Sound Instance At Sound Instance Name And Remove The ( And ) And Of Course Change UserId String To The Players UserId And name String To The Players Name
Use The :Stop() Function To Stop The Song Playing
If This Helped Accept The Answer!
You can use this function for playing sounds:
game.Workspace.sound:Play()
If I remember correctly, sounds that are placed in Workspace play for everyone.
When a player joins the game: http://wiki.roblox.com/index.php?title=API:Class/Players/PlayerAdded
tl;dr
game.Players.PlayerAdded:connect(function(player) if(player.name=="dester3x")then game.Workspace.sound:Play() end end)
Use this.
game.Players.PlayerAdded(function(plr) if plr.Name == "Player1" then --replace Player1 with the name of the person u want to be special --do whatever end end)
Or to be more safe
game.Players.PlayerAdded(function(plr) if plr.UserID == 123456 then --insert the special person's user ID --do whatever ene end)
Why do you want a specific player to turn on music? Why am i asking all theese questions?