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

I'm currently trying to create an EXP bar, but it's not really working out. How would I create one?

Asked by 7 years ago

This is the script for the leaderboard that I want to use

local maxlevel = 100

game.Players.PlayerAdded:connect(function(player)
    local stats = Instance.new("IntValue", player)
    stats.Name = "leaderstats"

    local azteige = Instance.new("IntValue", stats)
    azteige.Name = "AZTEIGE"
    azteige.Value = 1

    local exp = Instance.new("IntValue", stats)
    exp.Name = "EXPERIENCE"
    exp.Value = 0

    local astex = Instance.new("IntValue", stats)
    astex.Name = "ASTEX"
    astex.Value = 100

    while wait() do
        local extralevel = azteige.Value
        local expneed = ((extralevel * 2) -1) * 200
        if azteige.Value < maxlevel then
            if exp.Value >= expneed then
                azteige.Value = azteige.Value + 1
                exp.Value = exp.Value - expneed
            end
        end
    end
end)

Here is a link of the GUI that I wanna use for this http://imgur.com/dEnQMbZ

0
Can you show us the actual code you are having trouble with? TheDeadlyPanther 2460 — 7y

1 answer

Log in to vote
0
Answered by
Aepeus 59
7 years ago

I did not test but hopefully this helps!

while true do
wait()
local plr = game.Players.LocalPlayer
local stats = plr:WaitForChild('leaderstats')
local lvl = stats:WaitForChild('AZTEIGE')
local xp = stats:WaitForChild(EXPERIENCE')
local extralevel = azteige.Value
local expneed = ((extralevel * 2) -1) * 200

local math = xp.Value / expneeded
script.Parent[FRAME]:TweenSize(math,0,1,0),"Out", "Quad", .5)
end
0
Accept if this helped? Aepeus 59 — 7y
Ad

Answer this question