Module Function Unable to be Found?

Recently, I’ve been getting strange issues in my game, and I have had a rough time making a movement system for units in my game. And while my code has been riddled with difficult bugs, I have gotten a new one that returns the following error in my output:

  16:20:55.517  GetAvailableTiles is not a valid member of ModuleScript "ServerScriptService.Modules.MovementHandler"  -  Client - Selection:44
  16:20:55.518  Stack Begin  -  Studio
  16:20:55.518  Script 'Players.ProgrammingLiterals.PlayerGui.Selection', Line 44  -  Studio - Selection:44
  16:20:55.518  Stack End  -  Studio

I am honestly dumbfounded. The line in question is the following:

function module:GetAvailableTiles(xCoordinate, yCoordinate, movementRange)

And I call it like so:

return {unit[2], unit[6], unit[7], movementHandler:GetAvailableTiles(unit[3], unit[4], unit[6])}

If you need any more code let me know.
Any help is appreciated greatly!

From the look of the error, you didn’t require it

-- script
local module = require(modulescript) -- use "require" then insert the module script's directory
module:foo() -- use whatever is in the module
1 Like

Thank. You. So. Much. I feel so dumb for not seeing that earlier.

That and also, on the client, you can’t access server items located in ServerScriptService and ServerStorage. Store it in ReplicatedStorage to solve this.

No, that was because I was on a RemoteEvent, and it just handles the error that way.

1 Like