Car health help

Hello fellow developer!

Today I was wondering how I can make a car shootable for example!

Like when you shoot the car the car hp go -1 every time and when it is at 0 it explodes

I was also wondering if I do that should I use a humanoid or a value?

well, thank you!

You can just use an IntValue parented inside the car and listen for health changes by doing:

--script placed inside the car
local Car = script.Parent 
--health is an IntValue named "Health"
local Health = Car:WaitForChild("Health")

Health.Changed:Connect(function(amount)
	print("the car has "..amount.." health")
	if amount <= 0 then 
		--explode 
	end
end)

Yeah, but I was wondering if I could not use humanoid so like that you don’t have to create a thing to get the perfect gun damage!

I consider it possible, although I haven’t personally tried that, it may be a good solution cause you will be able to use Humanoid.Died and Humanoid:TakeDamage() although some of the other properties are useless for this.