I kinda forgot how to use mouse.Hit (btw, mousehit is defined as mouse.Hit in the local script)
game:GetService("Debris") script.Parent.SandFlightEvent.OnServerEvent:Connect(function(player, mousehit) local char = player.Character local bv = Instance.new("BodyVelocity") game.Debris:AddItem(bv, 5) bv.Parent = char.HumanoidRootPart bv.MaxForce = Vector3.new(1e8,1e8,1e8) while true do wait() bv.Velocity = Vector3.new(player.mousehit.lookVector) * 75 end end)
In order to shoot something in a given direction, the idea is to first 'point' the object in that direction, and then apply the velocity to it.
In order to point the object toward mouseHit, you can use the following:
CFrame.new(char.CFrame.p, mousehit.p);
This comes from the form (as shown in the wiki) CFrame.new(Vector3 pos, Vector3 lookAt), which will set your character's HRP to the position pos, while facing lookAt.
As a note, I'm not entirely sure why you're setting your maxforce parameters to 1e8; this is a large number, but it's much more standard to just use math.huge
.
I hope this helps.