This is my script:
local Tool = script.Parent
local cool = false -- Debounce
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
Tool.Activated:Connect(function(mouse)
if cool == false then
cool = true
local pos = mouse.Hit.Position -- Error here
Tool.RemoteEvent:FireServer(pos)
wait(1)
cool = false
end
end)
This is a local script and I put this in a tool. I'm trying to get the player's mouse position and send it to the script that activates when the remote event is fired. This error stopped all of my script. How can I fix this?

1 comment
put it in a code block please