i believe, i know the problem( or at least part of it) , Firstly i’m pretty sure you need to shift around your code a little bit, separate the player added and player removing function. The parsing error was because of this * that was next to Level.Value
local datastore = game:GetService("DataStoreService")
local data1 = datastore:GetDataStore("mystrengthdata")
local data2 = datastore:GetDataStore("myleveldata")
local data3 = datastore:GetDataStore("mygolddata")
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
local Level = Instance.new("IntValue", leaderstats)
Level.Name = "Level"
local Gold = Instance.new("IntValue", leaderstats)
Gold.Name = "Gold"
local strength = Instance.new("IntValue", leaderstats)
strength.Name = "strength"
strength.Value = data1:GetAsync(player.UserId) or 0
data1:SetAsync(player.UserId, strength.Value)
Level.Value = data2:GetAsync(player.UserId) or 0
data2:SetAsync(player.UserId, Level.Value)
Gold.Value = data3:GetAsync(player.UserId) or 0
data3:SetAsync(player.UserId, Gold.Value)
end)
game.Players.PlayerRemoving:connect(function()
data1:SetAsync(player.UserId, strength.Value)
data2:SetAsync(player.UserId, Level.Value)
data3:SetAsync(player.UserId, Gold.Value)
Exp.Changed:connect(function() ExpChange(Player,Exp,Level)
end)
function ExpChange(Player,strength,Level)
if strength.Value => Level.Value then
strength.Value = 0
Level.Value = Level.Value + 1
end
end
Not that i can see, from what i can tell it’s muliplying 1 and player.leaderstats.level.Value and adding player.leaderstats.level.Value , also i am guessing that is part of a script, since you have end)
In this example you are mistaking your order of operations. First the multiplication is done, then the addition. To prevent the level from multiplying before 1 is added, as @Jaycbee05 wrote, you need to put the value+1 into parenthesis so that the order of operations knows not to multiply first.