2DWorlds Forums
How do I add custom music to my server? - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Help (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=21)
+--- Thread: How do I add custom music to my server? (/showthread.php?tid=729)



How do I add custom music to my server? - Oak - 03-17-2013

I've always wanted to know how.


RE: How do I add custom music to my server? - Ghosty - 03-17-2013

Create Sound object in game. Name it "BGM" and put it directly in the world.

Add an MP3, WAV, or MIDI sound link to the Sound property of the Sound.

Whenever you want it to play, call this line somewhere in a script:

game.World.BGMConfusedtop()
sleep(0.1)
game.World.BGM:play()


If you just want it to play in your server, type "game.World.BGMConfusedtop() game.World.BGM:play()" into the Lua console of the server.


RE: How do I add custom music to my server? - Oak - 03-17-2013

(03-17-2013, 11:34 PM)Ghosty Wrote: Create Sound object in game. Name it "BGM" and put it directly in the world.

Add an MP3, WAV, or MIDI sound link to the Sound property of the Sound.

Whenever you want it to play, call this line somewhere in a script:

game.World.BGMConfusedtop()
sleep(0.1)
game.World.BGM:play()


If you just want it to play in your server, type "game.World.BGMConfusedtop() game.World.BGM:play()" into the Lua console of the server.

So lets say I make a music track or whatever, and wanna upload it into my game/server, how would I enter that link or source file into the Lua console of the server? Be more specific.


Also, can I use an already made song/track? Or would I risk copyright infringements?


RE: How do I add custom music to my server? - Ghosty - 03-18-2013

You can't just upload it to the server. It has to be hosted somewhere on the net.

Like, for example, one of these files:

http://keybored.x10.mx/musicdata/bdsmmidi/

Then, add the link to the Sound property of the Sound object.

If you need to create it through a script, here's an example:

s = create("Sound"); s.Name = "BGM"; s.Parent = game.World; s.Sound = "http://keybored.x10.mx/musicdata/bdsmmidi/Axel_F_Remix.mp3"

Then, use that script I posted above.