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

Why my obby progress bar gui isn't working?

Asked by 6 years ago
Edited 6 years ago
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


0
can you explain what part of the progress bar isn't working? theking48989987 2147 — 6y
0
and you can do game.Players.LocalPlayer instead of script.parent.parent.parent.parent.parent.parent theking48989987 2147 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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

Ad

Answer this question