Bean666 Posted May 17, 2016 Share Posted May 17, 2016 (edited) How can i make this sound repeat endless? addEvent("soundin",true) addEventHandler("soundin", getRootElement(), function () sound = playSound("sound/music.mp3", false) if isElement(sound) then setSoundVolume(sound, 0.2) end end ) Edited May 17, 2016 by Guest Link to comment
Walid Posted May 17, 2016 Share Posted May 17, 2016 All what you need is: "onClientSoundStopped" Link to comment
Bean666 Posted May 17, 2016 Author Share Posted May 17, 2016 never heard of that before. anyways ty, ill contact you when i got errors. Link to comment
Dealman Posted May 17, 2016 Share Posted May 17, 2016 playSound has a boolean for looping already, you've set it to false. Set it to true and it'll loop automatically. sound = playSound("sound/music.mp3", true) Link to comment
Bean666 Posted May 17, 2016 Author Share Posted May 17, 2016 function onSoundStopped() playSound( sound ) end addEventHandler ( "onClientSoundStopped", getRootElement(), onSoundStopped ) tried this , only got errors when sound ends. [expected string at argument 1 , got sound ] EDIT: OK thanks! never noticed that earlier 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