Hello, so im making a game that has a level up system in it. Most of the times when i join the game my exp and leveling is fine. But Sometimes this happends.
Gyazo Link
https://gyazo.com/8a684d9d12c18f3fb77f8645e5f8e0a0
Code
game.Players.PlayerAdded:Connect(function(player)
print(“Leveling6”)
wait(.1)
local Exp = player.Stats.Exp
local Level = player.Stats.Level
local Points = player.Stats.Points
local ExpNeed = player.Stats.ExpNeed
print(“Leveling87”)
while wait(.4) do
print("Leveling1")
if Exp.Value >= ExpNeed.Value and Level.Value <= 1999 then --and Level.Value <= 1999
print("Leveling2")
Level.Value = Level.Value + 1
print("Leveling3")
Points.Value = Points.Value + 3
print("Leveling4")
Exp.Value = Exp.Value - ExpNeed.Value
print("Leveling5")
ExpNeed.Value = ExpNeed.Value + 100
print("Leveling")
end
end
end)
end)
When i try to level up my levels dont increase. I put in print commands to show you where it suddenly stops even tho my exp is greater than my max exp. All values are also changed in server script so i dont think its a local script problem