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

How do i play music in a server?

Asked by
Dax4244 20
8 years ago

8/28/2015: im sorry that i cant put the script i tried up here i think im having a malwhere problem and roblox studio is not opening 8/29/2015: ok studio is working again and i tried this one and its not working

Variable=Instance.new("Sound".game.Workspace)
Varible.Soundid"rbxassetid://142830552"
Verible:play()
loop:false

im trying to make it so the music will play no loop when the player enters the server

5 answers

Log in to vote
2
Answered by
NotSoNorm 777 Moderation Voter
8 years ago

Well first off, This isn't a request site, But I will link you to some things you might need.

wiki link to audio: http://wiki.roblox.com/index.php?title=Sound

You're going to need to make the audio spawn in with a new instance (http://wiki.roblox.com/index.php?title=Instance), Then you're going to make that into every player that joins (http://wiki.roblox.com/index.php?title=API:Class/Players/PlayerAdded)

OR

You could go the more generic route and just put it in a block edit the ID then play it

Here's an example:

game.Players.PlayerAdded:connect(function(plr)
    local newmusic = Instance.new("Sound")
    newmusic.Parent = plr.Name
    newmusic.SoundId = "IDHERE"
    newmusic:Play()
end)
Ad
Log in to vote
0
Answered by 8 years ago

Simple, Paste the music you want into workspace, with the correct id= number and such. Then put a script into the sound. It should be like this.

wait(1) --I do this because sometimes it crashes if you don't
script.Parent:Play()

TAAAADAAAA

Or if you only want it to go at certain times you can put a script into workspace that activates it like.

For this example its for every 2 minutes it will play.

wait()
while true do
wait(120)
game.Workspace.Sound:Play() --Has to be specific name of your sound/music

--Remember for this you have to uncheck looped
0
if you want it to replay over and over Check the looped box CarterTheHippo 120 — 8y
0
wait in the game.Workspace.Sound:Play()? do i have to put the name of the song? or the id? Dax4244 20 — 8y
0
you can name the sound whatever your want, and lets say you name it blarg, and the sound is in workspace. You would do game.Workspace.Blarg:Play() The sound Id has nothing to do with it. Its the same way if you were to locate a part. Lets say part1 is in workspace. you would game.Workspace.part1.transparency = 1 CarterTheHippo 120 — 8y
0
what if i need to make it play when a player enters? Dax4244 20 — 8y
Log in to vote
0
Answered by 8 years ago

Easy. In StarterGui, make a local script. Then in the script, put the following:

game.Workspace.Sound:Play()

If "Sound" has a different name then replace "Sound" with the name of your sound. If you want it to keep going you should go to the properties of the sound and tick the looped box.

Log in to vote
0
Answered by 8 years ago

If you want just get an admin script and find the id and play :music [ID-GOES HERE], or if you want to do it from Studio, get a sound in Workspace, add the code into it where it says asset/id, then get a script inside of it saying:

`while true do wait (1) script.Parent:play() script:destory()

end`

Log in to vote
0
Answered by
duckyo01 120
8 years ago

Easy put the audio in workspace and then put the id in the sound click loop if you want. Now comes the scripting part. It is super hard.

game.Workspace.Sound:Play()-- if you changed the name of the Sound object change Sound to the name you changed it.

Answer this question