Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This could be anything in your sounds-folder.
- local song = "joinsounds/joinsound.mp3";
- if(SERVER) then
- -- Send this script to the players.
- AddCSLuaFile("joinsong.lua");
- -- Send the song to the players.
- resource.AddFile("sounds/" .. song);
- -- When a player spawns for the first time..
- hook.Add("PlayerInitialSpawn", "Play some song", function(ply)
- -- Send them an usermessage telling to play the song.
- SendUserMessage("playjoinsong", ply);
- end);
- else
- -- When we recieve the usermessage to play the song..
- usermessage.Hook("playjoinsong", function()
- -- Play it.
- surface.PlaySong(song);
- end
- end
Add Comment
Please, Sign In to add comment