Jump to content

I wand to change my gun sound on mta server


Kylsboy

Recommended Posts

Posted

Hello i wand to change my mta gun sounds but for my server but i doint know how to change it and its nowear on youtube

i hope someone will help me

Greating Robin

Posted
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

)

Posted

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> 

Posted

it says in de console couldnt find file GENRL/sound_005.mp3 for resource sounds

and than Loading of resource Sounds Failed

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

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