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

How can I play a sound to all players when a server owner joins? (Solved)

Asked by 10 years ago

Hello again,

Can someone help me make a script that plays a custom sound to all players when a server owner or specific player joins a server and only plays the sound once? Its kinda one of those "grand entrance" sorta things.

0
Don't make requests here. Kozero 120 — 10y
0
Try making a script by yourself first, if it doesn't work, then put it into your post and people can try help. infalliblelemon 145 — 10y

2 answers

Log in to vote
0
Answered by
Mowblow 117
10 years ago

Plays for everyone when the owner joins the server

local owner = "ctrlboy"
local music = game.Workspace.OwnerMusic
local g = 10 -- Make this 1 second longer than the audio's length is.
game.Players.PlayerAdded:connect(function(player)
if player.Name == owner then
music:Play()
wait(g)
music:Stop()
end
end)
0
Awesome it worked, thanks :D ctrlboy 5 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

I'm not sure how to do it when the owner joins, but to make it play to all for the whole server just do:

Game.Workspace.Sound:Play()

Answer this question