How do i fix this strange mouse issue?

code?

local orig = plr.Character.HumanoidRootPart.Position
local mouse = rs.Mouse:InvokeClient(plr)
local dir = (mouse - orig).Unit

cast:Fire(orig, dir, 600, castbehaviour)

client side

rs.Mouse.OnClientInvoke = function()
return plr.Mouse.Hit.Position
end)