Kenix Posted November 22, 2010 Posted November 22, 2010 I have made a script that when at the player of 90 hp plays a sound of knock of heart. But the script doesn't work help please! local HP = getLocalPlayer() heartsoundPlayer = function() local localHealth = getElementHealth(HP) if localHealth < 90 then playSound("heart.mp3", false) setSoundVolume(sound, 2.5) -- set the sound volume to 50% end end addEventHandler("onClientPlayerDamage", HP, heartsoundPlayer)
dzek (varez) Posted November 22, 2010 Posted November 22, 2010 wtf is line 3? i havent heard about defining functions like that.. replace with function heartsoundPlayer() also line 7 - setting volume over 1 has NO EFFECT (and comment on that line saying something about 50% is false)
Kenix Posted November 22, 2010 Author Posted November 22, 2010 Only there is a problem this sound always plays as to make that it didn't play after death?
Kenix Posted November 22, 2010 Author Posted November 22, 2010 There is a problem when the player dies a sound all the same plays = (
DiSaMe Posted November 22, 2010 Posted November 22, 2010 wtf is line 3?i havent heard about defining functions like that.. replace with function heartsoundPlayer() It's fine: http://lua-users.org/wiki/FunctionsTutorial
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