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)
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,