Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why my obby progress bar gui isn't working?

Stage = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Stage

while true do
script.Parent.Text = "Current stage: " ..Stage.Value.. "/100"
wait(0.1)
end

Second script

Stage = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Stage

while true do
wait()
local pie = Stage.Value * 1 / 100
script.Parent.Size = UDim2.new ( pie , 0 , 0 , 45)
end


2 comments

0

can you explain what part of the progress bar isn't working?

0

and you can do game.Players.LocalPlayer instead of script.parent.parent.parent.parent.parent.parent

1 answer

✓ Accepted answer

Works:

local Player = game.Players.LocalPlayer
local leaderstats = Player:WaitForChild("leaderstats")
local Stage = leaderstats.Stage

while true do
script.Parent.Text = "Current stage: " ..Stage.Value.. "/100"
wait(0.1)
end

Works:

local Player = game.Players.LocalPlayer
local leaderstats = Player:WaitForChild("leaderstats")
local Stage = leaderstats.Stage

while true do
wait()
local pie = Stage.Value * 1 / 100
script.Parent.Size = UDim2.new ( pie , 0 , 0 , 45)
end

I don't know what the error was but now it works. I only added this: local Player = game.Players.LocalPlayer local leaderstats = Player:WaitForChild("leaderstats") local Stage = leaderstats.Stage

This discussion is preserved as it was. New answers, comments, and votes are closed.