I've tryed adding the x y z of the velocity but it doesn't work. What could I do to get a force of a hit?..
script.Parent.Touched:connect(function(Part) local force1 = script.Parent.Velocity.X + script.Parent.Velocity.Y + script.Parent.Velocity.Z local force2 = Part.Velocity.X + Part.Velocity.Y + Part.Velocity.Z local TotalForce = force1 + force2 print("Damage was "..TotalForce..".") script.Parent.Damage.Value = script.Parent.Damage.Value + TotalForce end)
I believe there is no true force or energy in roblox, but there is p and Maxforce. For instance if this was a bullet or shell script you could define the part in the function, then check the part's children and find Bodyvelocity or other types of velocity. Then look at Maxforce and p to get what you need.