Jump to content

Damage sound


DarkByte

Recommended Posts

Posted

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.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
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

_____________________________

76561198299431254.png

Posted

Script please. I wanna see and learn.

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
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

CiTLh.png
Posted
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.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

Help?

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
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

Posted
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

Posted

Please help me fix it PLEASE. I cant make it.

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

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]<.

Posted
getLocalPlayer() -> getRootElement() or root for everyone...

check the weapon id, the miniguns id its: 38

getRootElement and root are the same.

Inactivo.

Posted

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 ) 

Posted

Not working

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

yes its in client side

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

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.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

When i damage other player and when i damage other player using vehicle too.

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
sound exist in file?

YEEES

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
addEventHandler("onClientPlayerDamage", root, 
function(attacker, weapon, bodypart) 
    if attacker and attacker == localPlayer and source ~= attacker then 
        playSound("hitmarker-sound.wav") 
    end 
end) 

CiTLh.png

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...