I'm trying to make a script where if a car is going over 70 AND it hits a part (yes, it destroys all the models children) it will BreakJoints(). Except that doesn't happen. It worked fine without the velocity part. Anyone help?
function onTouched(hi)
local Speed = 70
if script.Parent.Parent.Parent.VehicleSeat.Velocity.Magnitude >= Speed then
script.Parent:BreakJoints()
script.Parent.Parent:BreakJoints()
end end
connection = script.Parent.Touched:connect(onTouched)

7 comments
Have you tried checking how big is the velocity on impact? Also, how come the car is script.Parent.Parent but seat itself is that far back in ancestor list?
It's a special chassis, called SS3.57. The front, which can smash up, is grouped. There's body, wheels, etc.
Try putting print( script.Parent.Parent.Parent.Parent.VehicleSeat.Velocity.Magnitude ) for sake of debugging.
That is before the if line
I'll do that.
The number of speed does return into output on hit, but the joints don't break.
I got it working! Turns out that velocity is different to vehicleseat speed. Thank you, Zars!