Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

vehicle health and demolition?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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.

0
oh I see... and would the value be a 'Number Value'? and how would I check if it's lower? kapitanovaskapandr 0 — 10y
0
just do: if script.Parent.Health.Value <= 10 then so that means you are checking if it's 'lesser or equal to' ZarsBranchkin 885 — 10y
Ad

Answer this question