I'm making something quite confusing: a client script that calls a RemoteEvent that in turn calls a ModuleScript function. The client script and the RemoteEvent work fine, but once I introduce the line calling the ModuleScript function, it all breaks.
This is essentially what the ModuleScript is (some irrelevant parts have been omitted):
local Convert={} function Convert.CellToPosition(player,cell) --This function does a bunch of math and returns a position end function Convert.PositionToCell(player,position) --This function does a bunch of math and returns a cell end return Convert
This is how I call it from another script:
--Assume player and cell are not nil Convert.CellToPosition(player,cell)
This is the error that I get:
CellToPosition is not a valid member of ModuleScript
Any attempts of debugging the script have failed. Whenever I try to print something anywhere in the script, it doesn't appear.
You are attempting to access a child of a ModuleScript, not accessing the table it contains. In order to get the returned value from a ModuleScript, you have to require
it.
local Convert = require(ModuleScript)