DarkByte Posted October 14, 2015 Posted October 14, 2015 How to make a damage sound like when a player is shooting from a vehicle or a weapon and makes damage, how to play a sound when this happens? When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
LoOs Posted October 14, 2015 Posted October 14, 2015 How to make a damage sound like when a player is shooting from a vehicle or a weapon and makes damage, how to play a sound when this happens? 'onClientWeaponFire' playSound Discord: LoOs#1111 _____________________________
DarkByte Posted October 14, 2015 Author Posted October 14, 2015 Script please. I wanna see and learn. When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
TAPL Posted October 14, 2015 Posted October 14, 2015 How to make a damage sound like when a player is shooting from a vehicle or a weapon and makes damage, how to play a sound when this happens? 'onClientWeaponFire' playSound onClientWeaponFire is for custom weapons only, also he asked for damage which mean he need onClientPlayerDamage, not going to script instead of you ofc, learning is from this way: https://wiki.multitheftauto.com/wiki/Scripting_Introduction
KariiiM Posted October 14, 2015 Posted October 14, 2015 How to make a damage sound like when a player is shooting from a vehicle You can use this function to check if the player is in a vehicle or not isPlayerInVehicle
DarkByte Posted October 15, 2015 Author Posted October 15, 2015 function stopMinigunDamage ( attacker, weapon, bodypart ) if weapon then --if the weapon used was the minigun local sound = playSound("hit.mp3",player) setSoundVolume(sound, 50) end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage ) My script wont work When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
DarkByte Posted October 15, 2015 Author Posted October 15, 2015 Help? When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
Walid Posted October 15, 2015 Posted October 15, 2015 Help? wrong Argument you dont need to use player just put it like this local sound = playSound("hit.mp3") setSoundVolume(sound, 0.5) 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 October 15, 2015 Posted October 15, 2015 From where you got this argument 'player'? let him learn from his mistakes. he can find every thing here : playSound 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
DarkByte Posted October 15, 2015 Author Posted October 15, 2015 Please help me fix it PLEASE. I cant make it. When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
MisterQuestions Posted October 15, 2015 Posted October 15, 2015 getLocalPlayer() -> getRootElement() or root for everyone... check the weapon id, the miniguns id its: 38 "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
Enargy, Posted October 16, 2015 Posted October 16, 2015 getLocalPlayer() -> getRootElement() or root for everyone...check the weapon id, the miniguns id its: 38 getRootElement and root are the same. - Inactivo.
KariiiM Posted October 16, 2015 Posted October 16, 2015 By the way, localPlayer == getLocalPlayer function stopMinigunDamage ( attacker, weapon, bodypart ) if weapon then --if the weapon used was the minigun local sound = playSound("hit.mp3") setSoundVolume(sound, 50) end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )
DarkByte Posted October 16, 2015 Author Posted October 16, 2015 Not working When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
TAPL Posted October 16, 2015 Posted October 16, 2015 Make sure you have the code on client side not server side.
DarkByte Posted October 16, 2015 Author Posted October 16, 2015 yes its in client side When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
DarkByte Posted October 16, 2015 Author Posted October 16, 2015 Meta <meta> <script src="hit_c.lua" type="client" cache="false" /> <file src="hitmarker-sound.wav" /> </meta> Lua --[[function wasted (killer, weapon, bodypart) local sound = playSound("hit.mp3") --Play wasted.mp3 from the sounds folder setSoundVolume(sound, 1) -- set the sound volume to 50% end addEventHandler("onClientPlayerDamage", localPlayer, wasted) addEventHandler("onClientVehicleDamage", localPlayer, wasted) ]] function stopMinigunDamage ( attacker, weapon, bodypart ) if weapon then --if the weapon used was the minigun local sound = playSound("hitmarker-sound.wav") setSoundVolume(sound, 50) end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage ) addEventHandler ( "onClientVehicleDamage", getLocalPlayer(), stopMinigunDamage ) When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
TAPL Posted October 16, 2015 Posted October 16, 2015 You want the damage sound when you damage other player or when you get damaged by other player?
KariiiM Posted October 16, 2015 Posted October 16, 2015 (edited) Also check if the sound exist in file or not to declare it in the meta Edited October 16, 2015 by Guest
DarkByte Posted October 16, 2015 Author Posted October 16, 2015 When i damage other player and when i damage other player using vehicle too. When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
DarkByte Posted October 16, 2015 Author Posted October 16, 2015 sound exist in file? YEEES When I hear someone saying Mac is better than PC. w0t?w0t? w0t? Great minds discuss ideas, average minds discuss events and small minds discuss people.
TAPL Posted October 16, 2015 Posted October 16, 2015 addEventHandler("onClientPlayerDamage", root, function(attacker, weapon, bodypart) if attacker and attacker == localPlayer and source ~= attacker then playSound("hitmarker-sound.wav") end end)
KariiiM Posted October 16, 2015 Posted October 16, 2015 sound exist in file? YEEES So declare the file name of the sound in the meta like that filename/sound.mp3
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