Jump to content

Taser script help


johhnhd

Recommended Posts

I am trying to make a taser script so when you shoot with the silenced pistol you reload after every shot i made this but it didn't work im really stuck

function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) 
    if weapon == 23 then  
    reloadPedWeapon ( thePed ) 
    end  
end 

Link to comment

Try this:

Client Side:

addEventHandler("onClientPlayerWeaponFire", localPlayer, 
function(wp) 
    if (wp == 23) then 
        triggerServerEvent("onPlayerShot", localPlayer) 
    end 
end) 

Server Side:

addEvent("onPlayerShot",true) 
addEventHandler("onPlayerShot", root, 
function() 
    reloadPedWeapon(source) 
end) 

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