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

How do I stop scrape damage?

Asked by 2 years ago

I'm trying to make a vehicle damage system, but when the vehicle scrapes wall it deals constant damage, how can I stop this?

local impactVelocity = parent.Velocity.Magnitude local hitVelocity = hit.Velocity.Magnitude

if impactVelocity >= 40 or hitVelocity >= 40 then

if impactVelocity >= 40 then

    hp = hp - impactVelocity + 35

else

    hp = hp - hitVelocity + 10

end

end

0
You could make it so that when it detects the vehicle touches something, it deals a certain amount of damage depending on the velocity of the vehicle, and then waits until it stops touching that object. Fizzitic 0 — 2y

Answer this question