01 | function LevelNotify(lvl) |
02 | Player.PlayerGui.LevelNotify.LevelUp:Fire(lvl) |
03 | end |
04 | function onLevelUp(lvl) |
05 | LVL_HUE = math.clamp( tonumber (lvl), 1 , 100 ) / 100 * 0.8333333333333334 |
06 | Info.XP.Bar.Level.Text = "LEVEL " .. lvl |
07 | Info.XP.Bar.BackgroundColor 3 = Color 3. fromHSV(LVL_HUE, 1 , 0.19607843137254902 ) |
08 | Info.XP.Bar.Fill.BackgroundColor 3 = Color 3. fromHSV(LVL_HUE, 1 , 1 ) |
09 | end |
10 | Database.Notify.OnClientEvent:connect( function (action, ...) |
11 | local vars = { |
12 | ... |
13 | } |
14 | if action = = "new tp" then |
15 | onPointsAdded(vars [ 1 ] ) |
Im trying to make it so it doesnt loop, it only does the lvlnotify fire each time ur at a new level.
I dont know whats wrong with your script would need more info but this is what i use and its much much better, you can change the xpp required whenever and ittl auto update for the players. the function should be in a module returns a table and you can get the data by doing tbl[1] or tbl[2] or tbl[3] from the returned side
01 | module.get_rank = function (name) |
02 | local wins = --Players wins |
03 | local req = module.start_wins |
04 | local inc = module.wins_increase |
05 | local rank = 0 |
06 | repeat |
07 | if wins > = req then |
08 | wins = wins - req |
09 | req = req + inc |
10 | rank = rank + 1 |
11 | end |
12 | until wins < req |
13 | local tbl = { rank, wins, req } |
14 | return tbl |
15 | end |