HUD
Functions

Vehicle: damage Part

Damages a part on the vehicle.

Used in: VCMod Main addon.

Server Entity Vehicle:VC_damagePart(String class, Integer object, Entity att, Entity inf)

Arguments

1. String class; Class
The class of the object. Can be: 'wheel', 'exhaust', 'light'

2. Integer object; Object
The object of the class that you want to damage.

3. Entity att; Attacker
The player/NPC entity which the damage originated from. This argument is optional.

4. Entity inf; Inflictor
Entity which the damage was inflicted with, such as a weapon. This argument is optional.

Example

concommand.Add("vehicle_damage_front_left_wheel", function()
	local ent = player.GetAll()[1]:GetEyeTraceNoCursor().Entity
	if IsValid(ent) then
		local att = nil
		local inf = nil
		ent:VC_damagePart("wheel", 1, att, inf)
		print("Your front left wheel is now damaged.")
		print("Turning vehicles hazard lights on.")
	else
		print("Invalid entity.")
	end
end)
Page modified:
...2019-09-01 15:21:42