Module script can't call another module script

Hi,

--Serverscript:
****System:LoadSytemForPlayer(player)

--Module ****System
local Values = script.Parent["Values|Load|Save"]
local ****System = {}
function ****System:LoadSytemForPlayer(player)
	repeat local ret = Values:LoadPlayerData(player.UserId) if ret == false then task.wait(25) end until ret == true  --Heres the Error
[...]
return ****System
--Module 2:Values|Load|Save
[...]
local DataStoreVariable = {}
function DataStoreVariable:LoadPlayerData(userId)
	local ret = false
	[...]
	return ret
end
[...]
return DataStoreVariable

--##ERROR:
LoadPlayerData is not a valid member of ModuleScript "ServerScriptService.AntiCheat|****System.Values|Load|Save"  -  Server - ****System:37

Hirachy:
AntiCheat|****System
–Server Script
–****System
–Values|Load|Save

Thanks in advance for your help

2 Likes

If the method is defined in the ModuleScript, then it should have no issue calling it. Are you using require on the ModuleScript?

local data = require(PathToModuleScript)
data:LoadPlayerData() -- Should have no issue being called now that you required the module
2 Likes

Oups, I feel a bit stupid right now

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.