I forgot how to, I haven't done it in awhile.
local DataStore = game:GetService("DataStoreService")
local Levels = DataStore:GetDataStore("Levels")
local XP = DataStore:GetDataStore("XP")
local FrenzyCoins = DataStore:GetDataStore("FrenzyCoins")
local XPGoal = DataStore:GetDataStore("XPGOAL")
game.Players.PlayerAdded:Connect(function(plr)
local PlayerCurrency = Instance.new("Folder")
PlayerCurrency.Name = "PlayerCurrency"
PlayerCurrency.Parent = plr
local PlayerLevel = Instance.new("Folder")
PlayerLevel.Name = "PlayerLevel"
PlayerLevel.Parent = plr
local PrimalPoints = Instance.new("IntValue")
PrimalPoints.Name = "Primal Points"
PrimalPoints.Value = 0
PrimalPoints.Parent = PlayerCurrency
local FrenzyCoin = Instance.new("IntValue")
FrenzyCoin.Name = "Frenzy Coins"
FrenzyCoin.Value = FrenzyCoins:GetAsync(tostring(plr.UserId)) or 0
FrenzyCoin.Parent = PlayerCurrency
local Experience = Instance.new("IntValue")
Experience.Name = "XP"
Experience.Value = XP:GetAsync(tostring(plr.UserId)) or 0
Experience.Parent = PlayerLevel
local Level = Instance.new("IntValue")
Level.Name = "Level"
Level.Value = Levels:GetAsync(tostring(plr.UserId)) or 1
Level.Parent = PlayerLevel
local ExperienceGoal = Instance.new("IntValue")
ExperienceGoal.Name = "ExperienceGoal"
ExperienceGoal.Value = XPGoal:GetAsync(tostring(plr.UserId)) or 100
ExperienceGoal.Parent = PlayerLevel
Experience.Changed:Connect(function()
if plr.PlayerLevel:WaitForChild("XP").Value >= plr.PlayerLevel:WaitForChild("ExperienceGoal").Value then
print("Saving")
Level.Value = Level.Value + 1
ExperienceGoal.Value = ExperienceGoal.Value + 100
Levels:SetAsync(plr.UserId, Level.Value)
XP:SetAsync(plr.UserId, Experience.Value)
XPGoal:SetAsync(plr.UserId, ExperienceGoal.Value)
FrenzyCoins:SetAsync(plr.UserId, FrenzyCoin.Value)
print("Saved")
else
Levels:SetAsync(plr.UserId, Level.Value)
XP:SetAsync(plr.UserId, Experience.Value)
XPGoal:SetAsync(plr.UserId, ExperienceGoal.Value)
FrenzyCoins:SetAsync(plr.UserId, FrenzyCoin.Value)
print("Saved")
end
end)
end)
game.Players.PlayerRemoving:Connect(function(plr)
Levels:SetAsync(plr.UserId, plr.PlayerLevel.Level.Value)
XP:SetAsync(plr.UserId, plr.PlayerLevel.Experience.Value)
XPGoal:SetAsync(plr.UserId, plr.PlayerLevel.ExperienceGoal.Value)
FrenzyCoins:SetAsync(plr.UserId, plr.PlayerCurrency["Frenzy Coin"].Value)
end)

2 comments
Dude, thanks so much. Can't tell you how much I appreciate this.
perhaps pick my comment as the answer