I need help with setting the part size, it doesn't work the way i want it too

what im trying to do is when ever a player level’s up, a part in his Character will grow.
but what happens is it only changes once and not every single time the player level’s up.
i would really like yall to help me with this!

game.Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Parent = player
	leaderstats.Name = "leaderstats"
	
	local Points = Instance.new("IntValue", leaderstats)
	Points.Name = "Points"
	Points.Value = 0
	
	local Level = Instance.new("IntValue", leaderstats)
	Level.Name = "Level"
	Level.Value = 1
	
	local rxp = Instance.new("IntValue", player)
	rxp.Name = "RXP"
	rxp.Value = Level.Value * 100
	
	local exp = Instance.new("IntValue", player)
	exp.Name = "XP"
	exp.Value = 0
	
	exp.Changed:Connect(function(Changed)
		
		if exp.Value >= rxp.Value  then
			exp.Value = exp.Value - rxp.Value
			Level.Value = Level.Value + 1
			rxp.Value = Level.Value * 100
		end
	end)
	Level.Changed:Connect(function(Changed)
		local player = leaderstats.Parent
		local Char = player.Character
		local DigPart = Char:FindFirstChild("Dig") 
		if DigPart then
			DigPart.Size = Vector3.new(DigPart.Size.X, DigPart.Size.Y, DigPart.Size.Y + 10)
		end
	end)
	
end)

lol didn’t you just post?

I think your error lies in the fact that you have two events for the changing of the level.

Try making another separate script.

yeah i did just post but i’ve found another error, and i’ve been sitting around 20 mins trying to fix it. they dont both change the level, one changes the Exp, and the other one is the level,

Since you have your events inside of an event, my intuition is that they can only run once.

Which is why I say to put them inside of another script, unless I’m wrong.

That script inside of the player script can only run if the PlayerAdded event fires right?

ohhhh i get it. maybe thats the problem i’ll check

Also, you’re trying to check if a Value object has changed, which doesn’t make any sense.

Consider using the GetPropertyChangedSignal() event.

See more here:
https://developer.roblox.com/en-us/api-reference/function/Instance/GetPropertyChangedSignal

You acually got everything except where you say,
DigPart.Size.Y + 10

I think you want
DigPart.Size.Y += 10

Did you try the GetPropertyChangedSignal() event yet?