Jump to content

Solved.


Bean666

Recommended Posts

Posted (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 by Guest

Aftermath

Posted

All what you need is:

"onClientSoundStopped"  

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

Posted

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) 

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted
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

Aftermath

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...