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

Why as level reach next level it goes wrong?

Asked by 8 years ago

This a little part of the script (Max level 250) My problem is well their is one little problem, it works but when it reach level 2 it resets to -100 and i need to be 0 1l = 100xp reset to -100 need be 0 i tried to change (LevelStat.Value*100) to (LevelStat.Value=0) but then the xp system is broken 2l = 200xp

if LevelStat.Value < MaxLevel then
        if Stat.Value >= LevelStat.Value*100 then
            LevelStat.Value = LevelStat.Value + 1
            Stat.Value = Stat.Value - (LevelStat.Value*100)
        end
    end

thank you.

1
This is happening because you're changing the level before resetting the stat value. Someone downvoted your post, so I will neutralize it since this appears to be an easy fix. Just flip lines 3 and 4. M39a9am3R 3210 — 8y

Answer this question