game.Players.PlayerAdded:Connect(function(player)
	local exp = player.Stats.Exp
	local levels = player.Stats.Levels
	
	game.workspace.Events.Click.Click.OnServerEvent:Connect(function(player)
	player.Stats.Exp.Value = player.Stats.Exp.Value + 1
    end)
	
	while wait() do
		if exp.Value >= (100 * (levels.Value + 1)) then
			levels.Value = levels.Value + 1
			exp.Value = 0
			game.ReplicatedStorage.Events.LevelUpGui:FireClient(player)
		end
	end
end)

3 comments

0

Assuming that you already have a script that adds "Stats" into the player when they join, you may want to add a wait (ex. local stats = player:WaitForChild("Stats")) and then continue from there. The code executes when a player is added so "Stats" may have not been added to the player yet which means that when this script runs, it can't find "Stats"

0

Marked as non-descriptive as in the "Why was my question marked as Non-Descriptive?" post, it states that the OP may not know where the problem is occurring. The OP didn't read the error and make an attempt or talk about how they tried to fix it.

0

I've confused on why does people liked to mark some question as non-descriptive? The question of title maybe already self-explanatory. By the way, I think there's no need to make more description of the question, just find out bugs. I think that's are the best way to make questions. (Sorry of if I typed things that doesn't contains any script helps.)