If you can please explain the "(a table value)" part for me pleas
-- Variables local xp_lvl_DataStore = game:GetService('DataStoreService'):GetDataStore('xp/lvlStore') local repStorage = game:GetService('ReplicatedStorage') local serverScriptStore = game:GetService('ServerScriptService') local xpChanger = repStorage:WaitForChild('Xp_LvlChanged') local xpToAdd = 5 local part = script.Parent local maxLvl = 350 local xp_LvlModule = require (serverScriptStore.Xp_LvlModule) -- Events local success,message = pcall (part.ClickDetector.MouseClick:Connect(function(plr) local key = 'Player-'..plr.UserId local xpLvlTable = xp_lvl_DataStore:GetAsync(key) -- Fire to player xpChanger:FireClient(plr,xpToAdd) -- Sends added xp then saves xp_LvlModule(xpToAdd,key) print('Xp: '..xpLvlTable[1]..' Lvl: '..xpLvlTable[2]) end))
It errors on line 18
xp_LvlModule
is the module script that you required
on line 09
, and module scripts aren't callable. You're trying to call a function inside the module script, so you have to index it by specifying the function name as well: xp_LvlModule.FunctionName(params)
.