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)
The code seems fine so the issue should be the implementation/theory. Have you checked the value of Velocity.Magnitude? Print this out before your if statement, as this will be the true indicator as to why your if statement never equals true.