"Argument count mismatch" on module script functions

So in my module script that handles camera movements, I have a function for panning to a part. More specifically, a function that fires a remote to tell each client in a table passed as an argument to pan:

	function CameraTools.PanToPart(players: {Player}, part: BasePart)
		for i=1,#players do
			script.PanToPart:FireClient(players[i], part)
		end
		return task.wait(defaultPanSpeed)
	end

However, the new typechecking doesn’t like this function for some reason:


Any ideas?

The problem is not on the Luau type checking. (Check the picture below)
(https://gyazo.com/9a7dfec71ad210678635c3754bb296e6)

strange… when i change the part parameter to “any” the error goes away as well… what could be causing this?

Not sure since you didn’t show us all the codes, but one thing for sure is the problem is not on the Luau type checking.

the module is split into a client and server side, and when i remove the client version of the function (not accessible within this functions scope), the error goes away.

How are you defining CameraTools’ type?

Are you doing something like this?:

type cameraTools = {(any) -> (...any)}

If so, try switching it to

type cameraTools = {(...any) -> (...any)}
1 Like

this fixed it, and at a perfect time, I was just about to go look up how to make types for my modules! thank you!

1 Like