Play a sound through a server script

i’m almost done with my game, i just realised that the final touch is missing: the music

  1. What do you want to achieve? I need to make music play through a server script, because i need different music to play in different moments which are estabilished in the server script

  2. What is the issue? i don’t know how to do that

  3. What solutions have you tried so far? i looked around in the dev forum but i couldn’t find anything

please this is the only thing missing to my game

Heres what you should do:

Insert your sounds in SoundService

Make a folder in Replicated Storage, and put a remote event in the folder - one for each sound.

make a script in ServerScriptService called “Handler” or something like that.

make a variable for each sound in the script by referencing the sounds that you put in SoundService

Make events for each sound, and then in those events fire the remote events using FireAllClients() -

now, add a local script in StarterGui

name that script “localhandler” or something like that

once again, make a variable for each sound, and in that script have a line for each of the RemoteEvents you created using the OnClientEvent() function

and finally, in those events, play the sounds. If you have quesitons let me know!


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.