Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

Why does Studio skip 7 and adds 8000 by their self?

Asked by 5 years ago
Edited 5 years ago
01if script.Parent.Parent.LoadingDone.Value == false then
02        while true do
03            if current < player.leaderstats.Levels.Value * 1000 then break end
04            current = current - (player.leaderstats.Levels.Value * 1000)
05            print(current)
06            player.leaderstats.Levels.Value = player.leaderstats.Levels.Value + 1
07            print(player.leaderstats.Levels.Value)
08            wait()
09        end
10        levelexp = current
11        current = player.Exp.Value
12        script.Parent.Parent.LoadingDone.Value = true
13        level = player.leaderstats.Levels.Value
14        lead_level = player.leaderstats.Levels
15    end

This is a part of my code. So let's say we have 15000 exps. (When first joining the game) we will load the exp to levels. In Level 1 you need 1000 on lv 2 you need 2000 etc. like that well I'm not very used to repeat ~ until, so I replaced it with a while statement. I will tell you the outputs

0114487 -- Exp
02  2 -- Level
03 12487 --Exp
04  3 -- Level
05  9487
06  4
07  5487
08  5
09  487
10  6
11  8487
12  8
13  487
14  9

well, you can't do 487 -(6*1000), so I thought it will stopover here, but instead, Lv7 disappeared and the exps became 8487 and straight went to Lv9. Why did studio do this?

0
Or Should I make another datasave 'Levels'' tree_tree00 48 — 5y
0
Would you mind inviting me to your studio for team create, as I just tested this out on my own and it worked fine. BuDeep 214 — 5y
0
What code have you used? tree_tree00 48 — 5y

Answer this question