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) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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) Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Kenix Posted November 22, 2010 Author Posted November 22, 2010 And all works excuse http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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? http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
dzek (varez) Posted November 22, 2010 Posted November 22, 2010 whaat? Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Kenix Posted November 22, 2010 Author Posted November 22, 2010 There is a problem when the player dies a sound all the same plays = ( http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Kenix Posted November 22, 2010 Author Posted November 22, 2010 i fixed script http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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