#RooTs Posted May 16, 2016 Posted May 16, 2016 Hello friends. how can I use this function to start and stop when I want? local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, false) good. I imagine that I can use these functions local sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, false) function playMySound() playSound( sound ) end addCommandHandler ( "playsound", playMySound ) function stopMySound() stopSound( sound ) end addCommandHandler ( "stopsound", stopMySound ) is correct? what I have to do to. stop or start my sound in 3D?
Walid Posted May 16, 2016 Posted May 16, 2016 function sounFunction(cmd) if cmd == "playsound" then if isElement(sound) then stopSound( sound ) end sound = playSound3D("sounds/song.mp3", 373.14, -125.21, 1001, false) elseif cmd == "stopsound" then if isElement(sound) then stopSound( sound ) end end end addCommandHandler ("playsound", sounFunction) addCommandHandler ("stopsound", sounFunction) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Walid Posted May 17, 2016 Posted May 17, 2016 Np Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
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