local p = game.Players.LocalPlayer
local m = p:GetMouse()
local t = script.Parent
local r = script.Parent.RemoteEvent
local function a ()
local t = m.Target
r:FireServer(t)
end
t.Activated:Connect(a)
Error on line 4, Client/Server side shows the RemoteEvent inside the tool.
EDIT : It's a LocalScript.. obviously and it is inside the tool.. obviously.

5 comments
Where is the script located?
its a localscript inside the tool
after testing your script I have came across two issues. the first is if your testing in solo mode inside the studio your localscript will throw an error if its immediately enabled. however if you disable the localscript, then after your character loads enable the localscript, it will then not throw an error. the other problem is your function will not activate the remote event. im not sure why t
that's.. wrong
but good effort..