Hey everyone!
I got this error and I’m not sure why it’s occuring

it occurs when the game is joined, not when its actually invoked, any ideas on what the problem is and how to fix it?
(script)
local rs = game:GetService("ReplicatedStorage")
local uis = game:GetService("UserInputService")
local winchRemoteFunction = rs:WaitForChild("Winch")
local inputRemoteFunction = rs:WaitForChild("Input")
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
winchRemoteFunction.OnClientInvoke:Connect(function()
mouse.Button1Up:Wait()
return mouse.Target
end)
Thanks for the help 