the error is: bad argument #2, to ? (Vector3 expected, got number)
1 | local tgt 1 = m.Hit.p |
2 | v.velocity = tgt 1 * 100 |
Other things you should know before you call me out on it: 1: I left out most of the script on purpose, and left these two lines as they are linked as a problem. And I know that everything is defined. v is a bodyvelocity object m is the mouse of the player
I think it is because Hit is nil for a brief moment at some point. This can happen if the player looks into the sky or anywhere there are no parts. To fix this, try this:
1 | local target = m.Hit |
2 | if target ~ = nil then |
3 | local tgt 1 = target.p |
4 | v.velocity = tgt 1 * 100 |
5 | end |
Instead try Vector3.new(100,100,100)
. Reading from what the output said, 100 is a bad argument so try using a Vector3.