Jump to content

soundgun not working


Machine

Recommended Posts

i am trying to change the sound of the default m4

local distance = 75 --distance from where you can hear the shot 
local explostionDistance = 150 
  
local cSoundsEnabled = true 
local reloadSoundEnabled = true 
local explosionEnabled = true 
  
--shoot sounds 
function playSounds(weapon, ammo, ammoInClip) 
    if(cSoundsEnabled)then 
        local x,y,z = getElementPosition(source) 
        if weapon == 31 then --m4 
            if(ammoInClip == 0 and reloadSoundEnabled)then 
                mgReload("sounds/weapons/m4_reload.wav", x,y,z) 
            else 
                local sound = playSound3D("sounds/weapons/m4_shooting.wav", x,y,z) 
                setSoundMaxDistance(sound, distance) 
            end
        end
    end
end

still it doesnt replace anything what am i doing wrong please help 

Link to comment

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