kalyn Posted August 19, 2012 Posted August 19, 2012 Hi guys! I would to know how can I make the tank from invulnerable to vulnerable, because in my servere when a player is in a tank noone can kill him.... Thanks!
Castillo Posted August 19, 2012 Posted August 19, 2012 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.
kalyn Posted August 19, 2012 Author Posted August 19, 2012 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...
sockz Posted August 19, 2012 Posted August 19, 2012 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)
kalyn Posted August 20, 2012 Author Posted August 20, 2012 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.....
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now