Jump to content

Kiling tank with RPG


Xwad

Recommended Posts

i have write this in the .lua file is it good?

local weaponsToDamageRhino = {

[35] = true, -- basis RPG

[36] = true, -- Heatseaking RPG

-- You can add different weapons too apart from RPG, if not then a table isn't necessarily needed.

-- The [number] is the weapon ID, true means it's valid, every other number returns false.

}

function handleRhinoDamage(attacker, weapon, loss, x, y, z, tyre)

if (weapon and getElementModel(source) == 432 and loss > 0) then

-- if the weapon exists and the vehicle being shot is a Rhino and

-- the damage dealt isn't 0 but any number higher then do the following.

if (weaponsToDamageRhino[weapon]) then

-- if the weapon is one of the valid ID's above (35 'true' and 36 'true') then do the following.

setElementHealth(source, getElementHealth(source) - loss)

-- set the health (life points) of the Rhino (source is the vehicle being shot)

-- too the current health minus the loss.

end

end

end

addEventHandler("onClientVehicleDamage", root, handleRhinoDamage)

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