Okay I very don't understand? I want have access has my ModuleScript in my LocalScript. So I have create a RemoteFunction but I received this error...
Error: Attempt to call method 'ChangeStat' (a nil value)
ModuleScript Position = ServerStorage
(ExpSystem) LocalScript:
--local PlayerStatManager = require(game.ServerStorage.PlayerStatManager)
local Func = workspace.AccessServer:WaitForChild('AccessModuleScript')
local PlayerStatManager = Func:InvokeServer()
local expression = player.leaderstats.Level.Value * 2 * math.floor(500 * (3 ^ (3 / 15.47452)))
local player = game.Players.LocalPlayer
player.leaderstats.Exp.Changed:connect(function()
if player.leaderstats.Exp.Value >= expression then
PlayerStatManager:ChangeStat(player, 'Level', 1)
end
end)
(RequireInfo) Script:
local Func = workspace.AccessServer:WaitForChild("AccessModuleScript")
function Func.OnServerInvoke()
local PlayerStatManager = require(game.ServerStorage.PlayerStatManager)
return PlayerStatManager
end

2 comments
Whatever code that the Module returns doesn't seem to consist of a
ChangeStatfunction.But in the module there is a function named 'ChangeStat'?