Error in line 39 + 41
local Rep = game:GetService("ReplicatedStorage")
local DataStore2 = require(Rep:WaitForChild("MainModule"))
DataStore2.Combine("Data","Level","Exp","MaxExp")
local DefualtLevel = 1
local DefaultExp = 0
local DefaultMaxExp = 40
game.Players.PlayerAdded:Connect(function(Plr)
local UpdLevel = DataStore2("Level",Plr)
local UpdExp = DataStore2("Exp",Plr)
local UpdMaxExp = DataStore2("MaxExp",Plr)
local Leveling = Instance.new("Folder",Plr)
Leveling.Name = "Leveling"
local Level = Instance.new("IntValue",Leveling)
Level.Name = "Level"
local Exp = Instance.new("IntValue",Leveling)
Exp.Name = "Exp"
local MaxExp = Instance.new("IntValue",Leveling)
MaxExp.Name = "MaxExp"
local function UpdateLevel()
Level.Value = UpdLevel:Get(DefualtLevel)
end
UpdateLevel()
UpdLevel:Get(UpdateLevel)
local function UpdateExp()
Exp.Value = UpdExp:Get(DefaultExp)
end
UpdateExp()
UpdExp:Get(UpdateExp)
local function MaxExp()
MaxExp.Value = UpdMaxExp:Get(DefaultMaxExp)
end
MaxExp()
UpdMaxExp:Get(UpdMaxExp)
end)
