OnClientInvoke is a callback member of RemoteFunction; you can only set the callback value, get is not available

Hey everyone!

I got this error and I’m not sure why it’s occuring
image
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 :slight_smile:

2 Likes
winchRemoteFunction.OnClientInvoke = function()
	mouse.Button1Up:Wait()
	return mouse.Target
end

Replace the last part with this.

8 Likes