ID:273681
 
Although i have picked up quite a bit of experience in coding, i havent even delved into sound yet. So i need help.

Can someone please tell me how to make a music file play repetitively (bg music) but only when the user is on a specific x level? i have tried, but it lags all the time D:
You could make it to where if they enter a certain turf it plays a file example:

turf
Bravil
Wooden_Door
name = "Door to Bravil"
icon = 'Turfs.dmi'
icon_state = "40"
Entered()
if(usr)
usr.loc=locate(1,5,6)
usr<<sound('theme.ogg')
usr << "Welcome to Bravil!"


Hope that helps you I just made it and tested it so it works!
In response to XxBloody NightmarexX
Yeah, I'd say ideally you just play the music when you enter an area and delete it when you leave, no need to make an actual proc for that.
In response to XxBloody NightmarexX
            Entered()
if(usr)
usr.loc=locate(1,5,6)
usr<<sound('theme.ogg')
usr << "Welcome to Bravil!"


Don't use usr in procs. Especially not Entered() and such. Instead, this should be:

            Entered(atom/movable/A)
if(ismob(A))
A.loc=locate(1,5,6)
A<<sound('theme.ogg')
A << "Welcome to Bravil!"