Jump to content

[Help]onClientVehicleDamage Armoured vehicle


Qwark

Recommended Posts

Hi,

I make a server with friends and we love car chases but cars are destroyed too quickly and must change all the time, so I wonder if there was a script that makes the patriot armoured?

I saw the wiki but I'm not a programmer and I do not want to learn to program, I tried to follow this page

https://wiki.multitheftauto.com/wiki/On ... icleDamage

but to no avail, I understands nothing.

So if anyone could help me please?

Thanks.

Ps: I tried setDamageProof but the car is so indestructible, I just want a stronger car.

Link to comment

Try using this code (client), it should make the Patriot twice as strong:

  
addEventHandler ( "onClientVehicleDamage", root, function ( _, _, loss ) 
    if ( getElementID ( source ) == 470 ) then 
        setElementHealth ( source, getElementHealth ( source ) + math.floor ( loss / 2 ) ) 
    end 
end ) 

Link to comment

Thank you, I tried your script but it does not work, the car is still destroyed at the same number of bullets, would you have another idea?

For now, so I have two script call server.lua and client.lua with meta.xml file that loads the script, I put your code in client.lua (I also tried the server. lua) but I can not find anything.

Link to comment

i think if you change getElementID to getElementModel it works.

  
  
addEventHandler ( "onClientVehicleDamage", root, function ( _, _, loss ) 
    if ( getElementModel ( source ) == 470 ) then 
        setElementHealth ( source, getElementHealth ( source ) + math.floor ( loss / 2 ) ) 
    end 
end ) 
  

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