Jump to content

Client custom weapon


DRW

Recommended Posts

Hello, I have a problem. I'm using custom weapons with createWeapon, I'm going to explain the problem:

First of all, I create a weapon and set an ElementData to this weapon, something like this:

weapon1 = createWeapon ("minigun",x,y,z) 
setElementData(weapon1,"owner",getPlayerName(localPlayer)) 

then when a weapon kills the ped use this onClientPedWasted:

local pyer = getPlayerFromName(getElementData(weapon1,"owner")) 
  
setElementData(pyer,"kills",getElementData(pyer,"kills")+1) 

As you see, the script is ok, but onClientPedWasted only supports player and vehicle elements, what can I do?

I've tried using onClientWeaponFire to check if a ped is dead and then setting the "kills" elementData but somehow it adds more kills than 1.

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