Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Audio that plays when certain player enters?

Asked by 8 years ago

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

3 answers

Log in to vote
0
Answered by
Filipalla 504 Moderation Voter
8 years ago
Edited 8 years ago

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!

Ad
Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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)
0
above script works skyab12 25 — 8y
Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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?

0
SH_Helper, you have a typo on line 7, perhaps it should be spelled "end" not "ene". OptimisticSide 199 — 6y

Answer this question