ok, so this is not that hard to do. There is something called "Changed" this event happens whenver the number value is changed, you can find the artical here:
https://developer.roblox.com/en-us/api-reference/event/NumberValue/changed
script:
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local exp = Instance.new("IntValue", player)
exp.Name = "Exp"
local max = Instance.new("IntValue", player)
max.Name = "Max"
max.Value = 100
local level = Instance.new("IntValue", leaderstats)
level.Name = "Level"
level.Value = 1
exp.Changed:Connect(function(value)
print("expValue Changed")
if value == max.Value then
exp.Value = 0
level.Value += 1
max.Value += 50
print("YAY U LEVELED UP!!")
end
end)
end)
2 comments
Max is another NumberValue? If yes, then, try to put Max.Value
Have you checked the path?