Vehicle Damage Problem

Hello! I’m back as always with a new problem, this time I’m trying to enable vehicle damage through a piece of code but it doesn’t seem to work(The vehicle part of it at least, the anti team kill works perfectly). I made sure that the person in the vehicle is different from the one that is supposed to take damage although I don’t think this would matter since its checking if the attacker is a vehicle but I figured I’d mention it. Any help/hints is greatly appreciated!



function GM:PlayerShouldTakeDamage(attacker, victim)
	if victim:IsPlayer() then
		if attacker:Team() == victim:Team() then
			return false else
				return true
		end
	end
	
	if victim:IsPlayer() then
		if (attacker:IsVehicle() or attacker:GetClass()== "prop_vehicle_jeep") then
			return true
		end
	end
end
hook.Add("PlayerShouldTakeDamage", "EnableVehicleDamage", EnableVehicleDamage)

What is in your EnableVehicleDamage function? You seem to be overriding the core function in your example and then hooking to a non existant function unless I misunderstood something

I figured it out, I removed the hook and forgot to return true after all the if statements :stuck_out_tongue: