Home / Lua / Events / Client / VehicleCollide

Name    VehicleCollide
Arguments (in table)    Vehicle attacker, Vehicle vehicle, Player player
Return option    None

Description

Fired when a vehicle collides with either a player or another vehicle. attacker is always a valid vehicle. Only one of vehicle or player is used, not both.

Examples

Foo = function(args)
	if args.vehicle then
		print(args.attacker:GetName().." collided with "..args.vehicle:GetName())
	elseif args.player then
		print(args.attacker:GetName().." collided with "..args.player:GetName())
	end
end

Events:Subscribe("VehicleCollide", Foo)