• Gamemode Sound
    4 replies, posted
I crawled all around the internet to find a answer.But nope. I have a startup sound at content/sound/music/startupsound.mp3 I wanted to play the sound with surface.playsound but i soon realized its clientside I dont want to use sound.play becouse it relies on coordinates. Is there any way i can accomplish this? Its really annoying becouse i have done atleast 10 google searches
why would you want a startup sound to play serverside? if you want to use sound.Play you could set the coordinates to the player it's playing on with player:GetPos() but this probably isn't a good solution
Just use surface.PlaySound clientside, or each client or whatever. I also suggest you choose a more unique file name for your server's sounds so that they won't get overridden by client mods or other servers.
[QUOTE=Splerge;49440340]why would you want a startup sound to play serverside? if you want to use sound.Play you could set the coordinates to the player it's playing on with player:GetPos() but this probably isn't a good solution[/QUOTE] All i want is to play a song whenever a round starts. I dont want clients to control when its played or not so i need to make it serverside. I am disappointed there is no proper play sound commands for serverside yet EDIT1:Basically all i want is when a round starts it plays a song for everyone to hear just like in cs:go
Clients can't "control" the code you execute on them. There are plenty of proper ways of doing this. You just need to choose which one you wish to use. [editline]2nd January 2016[/editline] Ultimately, all sounds are played on the client either way. [editline]2nd January 2016[/editline] Here's another function that would work serverside allowing you to do this, if you use it properly: [url]http://wiki.garrysmod.com/page/Entity/EmitSound[/url] Read the argument descriptions in detail, click the links. Learn to educate yourself.
Sorry, you need to Log In to post a reply to this thread.