Jump to content

[HELP] How to make the tank vulnerable to bullets


kalyn

Recommended Posts

You could make a custom script which will lower tank health when player shoots a weapon.

onClientPlayerWeaponFire -- The event for when a player fires a weapon.

getElementType -- To check if the hit element is a vehicle. 
getElementModel -- To check if the hit vehicle is a "Rhino". 
setElementHealth -- To lower it's health. 

the problem is the tank is invulnerable i shoot about 20 rockets to him and the healt was at 100% and I need the tank to not blow the cars when he touches them, the only moment when the tank was losing healt was when you colide whit some objects...

Link to comment
function rhinohit(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
if getElementType(hitElement)=="vehicle" and getElementModel (hitElement) == 432  then 
    setElementHealth (hitElement, getElementHealth(hitElement)-50) 
    end 
end 
addEventHandler("onClientPlayerWeaponFire", root, rhinohit) 

Link to comment
function rhinohit(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
if getElementType(hitElement)=="vehicle" and getElementModel (hitElement) == 432  then 
    setElementHealth (hitElement, getElementHealth(hitElement)-50) 
    end 
end 
addEventHandler("onClientPlayerWeaponFire", root, rhinohit) 

doesn't work, the tank after 1 rocket explodes but when is a player in becomes invulnerable and whit other fireweapons you can't do nothing against it.....

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