sonic1 Posted October 5, 2016 Share Posted October 5, 2016 Hi guys I usually making destruction derby maps. And I saw in one derby map, when somebody die I heard a sound file like hahaha and I want to add this type of script in my map, but i have no idea how to do it. I can't find anything about it on wikia (I heard this sound when I died or when I watched somebody after my death Link to comment
iPrestege Posted October 5, 2016 Share Posted October 5, 2016 (edited) addEventHandler ( 'onPlayerWasted' ) triggerClientEvent playSound Edited October 5, 2016 by Mr.Pres[T]ege Link to comment
sonic1 Posted October 5, 2016 Author Share Posted October 5, 2016 thanks I will try script with it addEventHandler( "onPlayerWasted", getRootElement( ), function() wasted (killer, weapon, bodypart) local sound = playSound ("song.mp3", true) setSoundVolume(sound, 0.5) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), ClientStarted ) Is it correct ? i'm new in scripting Link to comment
iPrestege Posted October 5, 2016 Share Posted October 5, 2016 addEventHandler ( "onClientPlayerWasted", localPlayer, function ( ) local sound = playSound("song.mp3",false) setSoundVolume(sound, 0.5) end ) ClientSide script. Link to comment
sonic1 Posted October 5, 2016 Author Share Posted October 5, 2016 (edited) Guys one more thing Can you tell me how to set volume of song (this song is play during the map) I used it setSoundVolume(sound, 0.5) but nothing happened If need I can show you my playsound script Edited October 5, 2016 by sonic1 Link to comment
sonic1 Posted October 5, 2016 Author Share Posted October 5, 2016 solved I changed volume in other program Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now