Guest User

Untitled

a guest
Feb 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. -- This could be anything in your sounds-folder.
  2. local song = "joinsounds/joinsound.mp3";
  3.  
  4. if(SERVER) then
  5. -- Send this script to the players.
  6. AddCSLuaFile("joinsong.lua");
  7.  
  8. -- Send the song to the players.
  9. resource.AddFile("sounds/" .. song);
  10.  
  11. -- When a player spawns for the first time..
  12. hook.Add("PlayerInitialSpawn", "Play some song", function(ply)
  13. -- Send them an usermessage telling to play the song.
  14. SendUserMessage("playjoinsong", ply);
  15. end);
  16. else
  17. -- When we recieve the usermessage to play the song..
  18. usermessage.Hook("playjoinsong", function()
  19. -- Play it.
  20. surface.PlaySong(song);
  21. end
  22. end
Add Comment
Please, Sign In to add comment