Bean666 Posted April 17, 2021 Share Posted April 17, 2021 (edited) Hello , i've been trying to make rhino be damaged by RPGs or explosions and such, but it's hard to do it. 'on ID S.W.A.T tank explosions work, they do the damage, but for the rhino idk why it doesn't. I didn't restrict any Weapon IDs for now to check if it really works. but still explosions do not work on rhino despite the event. local armoredVehicles = { [432] = true, [601] = true } function warMachineDamage(attacker, weapon, loss, x, y, z, tire) local model = getElementModel(source) if weapon and armoredVehicles[model] then cancelEvent() triggerServerEvent ("damageWarMachine", source, source, attacker, weapon, bodypart ) end end addEventHandler("onClientVehicleDamage", root, warMachineDamage) Server: addEvent( "damageWarMachine", true ) function damageWarMachine( vehicle, attacker, weapon, bodypart) local vehicleHealth = getElementHealth(vehicle) setElementHealth(vehicle, vehicleHealth - 500 ) end addEventHandler( "damageWarMachine", root, damageWarMachine ) Does anyone know a workaround this? Like maybe use onClientExplosion? and maybe onClientPlayerWeaponFire then define the weapon and the hitElement then trigger the event? Edited April 17, 2021 by Bean666 Link to comment
Bean666 Posted April 17, 2021 Author Share Posted April 17, 2021 (edited) SOLVED. onClientPlayerWeaponFire + hitElement arg worked. Edited April 17, 2021 by Bean666 Link to comment
Recommended Posts