Jump to content

Changing melee weapons damage


Wisam

Recommended Posts

Hey

I made a script for my server to change the weapon property damage and accuracy but then i wanted to make another script where i can change the weapon property of the chainsaw and katana but i noticed that the melee weapons are not listed in the menu, only fire arms and projectiles so if you could help me do this that would be great :)

Also i tryed to do this but it didnt work:

function damage() 
  
setWeaponProperty(9,"poor","damage", 1000) 
  
end 
addEventHandler ( "onResourceStart", getRootElement(), damage ) 

Link to comment

try this

-- client 
local damageFromWeapon9 = 10 -- change here 
  
addEventHandler("onClientPlayerDamage", getLocalPlayer(), 
function(atack,weapon,bod,los) 
if(weapon == 9)then 
cancelEvent() 
local h = getElementHealth(source) 
if(h>damageFromWeapon9)then 
setElementHealth(source,h-damageFromWeapon9) 
else 
triggerServerEvent("killPedSpecial",source,atack) 
end 
end 
end) 
  
--server 
addEvent("killPedSpecial",true) 
addEventHandler("killPedSpecial",root, 
function(a) 
killPed(source,a) 
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...