How do I make this script about impact speed work? Basically I want a MeshPart to go transparent after it is hit at 90 speed and above. But, this is not working. Can anyone tell me what to do? I'm a rookie scripter and get most of my stuff off the internet.
part.Touched:Connect(function(hit)
speed = math.sqrt(hit.Velocity.X^2 + hit.Velocity.Y^2 + hit.Velocity.Z^2)
print(speed)
if speed > 90 then
script.parent.Transparency = 1
I know I need to put an "end" somewhere, but not sure where.

2 comments
If you're asking where you need to end each scope, you need to review the basics before attempting to do anything.
No, not just that. I'm just asking what I need to do to the whole script to make it work.