Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ** Warning **: This code is not tested so it might give errors.
- If that is the case please post what's wrong so it can be fixed fast.
- ]]--
- function playSoundOnStartMap ( )
- myNewMapSong = playSound ( "song.mp3" ) -- you're song name ( should be in the map folder )
- end
- addEventHandler ( "onClientResourceStart", root, playSoundOnStartMap )
- -- bind keys to turn on / off music
- function toggleSongOff ( )
- setSoundPaused ( myNewMapSong, true )
- bindKey ( "m", "down", toggleSongOff ) -- pause the song
- end
- function toggleSongBackOn ( )
- if (isSoundPaused ( myNewMapSong ) == true ) then
- local bindKeyToPlaySong = bindKey ( "m", "down", toggleSongBackOn )
- if ( bindKeyToPlaySong ) then
- setSoundPaused ( myNewMapSong, false )
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement