hello!
first you need to ensure that custom music files can be downloaded by the clients of other players, to do this you need to add an entry to your servers 'Folderconfig'
for the sake of an example, i am currently creating a server called Lardene (after my great grandmother, bless her soul
), so in folder config i have added:
file music/lardene_*.mp3
'file' means that this is a custom file rather than a level/sword/shield/head/body, 'music' is the name of the folder i have assigned for music because i like to keep my server organised, 'lardene_' is the prefix i use because you should always identify your servers files to avoid conflict (and force them to download to a convenient folder), and the '*' is a wildcard which allows any filename beyond the prefix, and ending it with 'mp3' means this only works for mp3 files
then you want to ensure that you can actually upload music files to this folder, so in rc type '/openrights', then click the 'Folder Rights' tab, and add a line such as 'rw levels/music/lardene_*.mp3', and finally save your rights
once this is setup and you have uploaded the file to the specified folder you can now play the music file clientside through script, a very basic example of how to do this within a singular level npc is as follows:
PHP Code:
//#CLIENTSIDE
function onPlayerEnters()
playlooped("lardene_inside_01.mp3");
i personally recommend joining a class script to npcs rather than playing files directly, so that if you want to change the way music plays you dont then have to go back and edit a lot of different npcs, an alternative would be to play music within a weapon npc according to what level you are within, which is helpful for playing music on gmaps
happy to be of help!