Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

vehicle health and demolition?

would I just need to insert a humanoid into the vehicle? cos am planning to make ships with health so they're sinkable... and for example, how would I make smoke come out of a certain part if the vehicle reached a certain health amount and the speed is lowered and so on, and then when there is 0 Health then the vehicle blows up and it cant be used, and the humanoid dies and then the vehicle sinks if its in water... you know wat I mean... and of course I would know how to make smoke come out when it reaches certain health

if script.Parent.Humanoid.Health == 10 then
script.Parent.Engine.Smoke.enabled = true

something like that, but I wouldn't know how to make the thing correctly were the explosion happens and the vehicle is disabled, of course am guessing it would look something like this

if script.Parent.Humanoid.Health == 0 then
script.Parent.VehicleSeat.enabled = false

anyways, thnx for listening guys.

1 answer

No, you shouldn't use humanoid. Just have number value within car, called 'Health' and when you damage the car, subtract some amount from that value. Then have a script that does the checks like you mentioned before, but instead of doing 'equals to', you should check if it's lower then, because there is a low chance that the health will match exactly 10.

2 comments

0

oh I see... and would the value be a 'Number Value'? and how would I check if it's lower?

0

just do: if script.Parent.Health.Value <= 10 then so that means you are checking if it's 'lesser or equal to'

This discussion is preserved as it was. New answers, comments, and votes are closed.