I am having trouble debugging this script, I want to make it so that every second the Experience changes by 1 and so that every five seconds that the Points change by 1, but the problem is that only the experience changes, not the Points. Here is the code.
game.Players.PlayerAdded:connect(function(plr)
local Stats = Instance.new("IntValue",plr)
Stats.Name = "leaderstats"
Experience = Instance.new("IntValue", Stats)
Experience.Name = "EXP"
Experience.Value = 0
local Level = Instance.new("IntValue", Stats)
Level.Name = "Level"
Level.Value = 0
local Points = Instance.new("IntValue", Stats)
Points.Name = "Money"
Points.Value = 0
while true do
Experience.Value = Experience.Value + 1
wait(1)
end
while true do
Points.Value = Points.Value + 1
wait(5)
end
Experience.Changed:connect(function()
Level.Value = math.floor (Experience.Value / 1000)
end)
end)
