Using this line of code, I just took a snippet out of my script, it gives me the error "attempt to index nil with 'Hit'". I have no idea what this means, can I not use a that code in a server script?
game.ReplicatedStorage.Events.ShootEvent.OnServerEvent:Connect(function(player)
local mouse = player:GetMouse()
local ray = Ray.new(hole.CFrame.p, (mouse.Hit.Position - hole.CFrame.p) * range.Value)
end)

6 comments
How would I send the position of the mouse to a server script though?
through the arguments
when using :FireServer, fire the position of the hit
So, like this? game.ReplicatedStorage.Events.ShootEvent:FireServer(ray)
precisely
It works, thanks.