Jump to content

I wand to change my gun sound on mta server


Kylsboy

Recommended Posts

  Dimos7 said:
you mean by script or just recplace the default sounds?

Yes

i have this

Meta:

Replace.lua

addEventHandler("onClientPlayerWeaponFire", getRootElement(),

function ( weapon, ammo, ammoInClip )

local x,y,z = getElementPosition(source)

if weapon == 30 then

local sound = playSound3D("GENRL/sound_005.mp3", x,y,z)

setSoundMaxDistance(sound,75)

end

end

)

Link to comment

try this

addEventHandler("onClientPlayerWeaponFire", root, 
function(weapon, ammo, ammoInClip) 
    local x, y, z = getElementPosition(localPlayer) 
    if weapon == 30 then 
       local sound = playSound3D("GENRL/sound_005.mp3", x, y, z) 
       setSoundMaxDistance(sound, 75) 
    end 
end) 

also in meta

change it like that

<meta> 
     <script src="replace.lua" type="client"/> 
     <file src="GENRL/sound_005.mp3"/> 
</meta> 

Link to comment
addEventHandler("onClientPlayerWeaponFire", root, function(weapon, _, _, _, _, _, _, x, y, z ) 
    if weapon == 30 then 
       local sound = playSound3D("GENRL/sound_005.mp3", x, y, z) 
       setSoundMaxDistance(sound, 75) 
    end 
end) 

Use it that way for better sound.

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