• Server join song help?
    3 replies, posted
[CODE]--Quick dirty script for playing sounds to players who join your server. --Edit to your hearts content. Rewrite it better. I'm not going major release with it. --See below where to edit/add sounds. If you use CUSTOM ones, make sure your player has them (Forcedownload, etc) --I used GCFScape for looking at what sounds are available. You may use Google. local UJoin_Sound_Ver = "[UJoin Sound] - v1 loaded" if SERVER then local UJoin_sounds = { } --=========EDIT HERE=========================================================== -- *Note* There is a ~255 character limit to one full sound path. Place trailing comma. UJoin_sounds = { "the song I have put in", } --==========Don't edit below here (unless you know how) ======================== MsgN( UJoin_Sound_Ver ) AddCSLuaFile( "autorun/UJoin_Sounder.lua" ) function Send_Some_Sound( ply, steamid ) umsg.Start( "UJoin_sound", ply ) umsg.String( UJoin_sounds[ math.random( 1, table.getn( UJoin_sounds ) ) ] ) umsg.End() end hook.Add("PlayerAuthed", "SendASound", Send_Some_Sound) else MsgN( UJoin_Sound_Ver ) function UJoin_Play_sound( um ) UJoin_snd = um:ReadString() util.PrecacheSound( UJoin_snd ) surface.PlaySound( UJoin_snd ) end usermessage.Hook("UJoin_sound", UJoin_Play_sound ) end[/CODE] So i have put the song link in and put this in lua/autorun what have i done wrong? Because the song dose not work.
"--See below where to edit/add sounds. If you use CUSTOM ones, make sure your player has them (Forcedownload, etc)" Have you done all this?
Have you got the song on both server and client? Is the sound a WAV or MP3 format (Tested and proven 100% to work as WAV)
Yea make sure, to add the sound to the server, if not the data won't detect the wav/mp3
Sorry, you need to Log In to post a reply to this thread.