game.Players.PlayerAdded:Connect(function(player)
	local levelInfo = Instance.new("Folder")
	levelInfo.Name = "LevelsInfo"
	levelInfo.Parent = player
	
	local level = Instance.new("IntValue")
	level.Name = "Level"
	level.Value = 1
	level.Parent = levelInfo
	
	local exp = Instance.new("IntValue")
	exp.Name = "Experience"
	exp.Value = 0
	exp.Parent = levelInfo
	
	local xpNeeded = 5 * 1.01 ^ level.Value
	
	exp.Changed:Connect(function(newExp)
		if newExp >= xpNeeded then
			level.Value +=1
			exp.Value -=xpNeeded
			xpNeeded = 5 * 1.01
			
			while true do
				player.LevelsInfo.exp.Value = player.LevelsInfo.exp.Value + 1
				wait (30)
			end
			
		end
	end)
end)

Lines 24 through 27 are what we are primarily looking at. It's suppose to be a basic loop function that gives players 1 exp every 30 seconds, continuously and forever. I'm not getting any error messages, but the exp will is not adding on.

I'm assuming there's a problem with where the function is embedded, should it be it's own standing function?

1 comment

0

Everything looks great to me, I had this problem before but I don't remember how I fixed it or if I even did, btw you can do '+=' instead of '= player.LevelsInfo.exp.Value + 1'