So Hello guys, I want to make gun sounds on my server, so I have found one script from the internet which looks like this
addEventHandler("onClientPlayerWeaponFire", getRootElement(),
function ( weapon, ammo, ammoInClip )
local x,y,z = getElementPosition(source)
if weapon == 30 then
local sound = playSound3D("Ak.wav", x,y,z)
setSoundMaxDistance(sound,75)
end
end
)
so ak for me worked but I have a problem, I cant do m4 because it has 30 bullets too, sniper doenst have magazines bullets can go over 9999 please help me, script works for me but some guns like snipers dont