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

Bar wont move despite the value being setup correctly?

Asked by
Fatul 9
8 years ago

I made this at like 6 AM so i'm not sure if i just cant spot the problem, or roblox is being dumb. I seperated the two in different loops because it would error otherwise.

Door = game.Workspace.DoorClaim
TKRWin = game.Workspace.TKRWinClaim

--//Defence\\
Door_Defence = Door.Defence
Door_Max_Defence = Door.Defence.MaxDefence

TKR_Defence = TKRWin.Defence
TKR_Max_Defence = TKRWin.Defence.MaxDefence

--//UI\\
TKR = script.Parent.TKR
Objective = script.Parent.Objective

while wait(.1) do 
    if  Door.Captured == true then
        Objective.Text = "TKR Center"
        --
        pie = (TKR_Defence.Value/TKR_Max_Defence.Value)
        TKR.AbsoluteSize = UDim2.new(pie, 1)     <-- here   
    end
end
--
while wait(.1) do 
    if  Door.Captured == false then
        Objective.Text = "Door"
        --
        pie2 = (Door_Defence.Value/Door_Max_Defence.Value)
        TKR.AbsoluteSize = UDim2.new(pie2, 1) <-- and here          
    end
end
0
UDim2.new(pie,0,1,0) and UDim2.new(pie2,0,1,0) RockerCaleb1234 282 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago
Door = game.Workspace.DoorClaim
TKRWin = game.Workspace.TKRWinClaim

--//Defence\\
Door_Defence = Door.Defence
Door_Max_Defence = Door.Defence.MaxDefence

TKR_Defence = TKRWin.Defence
TKR_Max_Defence = TKRWin.Defence.MaxDefence

--//UI\\
TKR = script.Parent.TKR
Objective = script.Parent.Objective

while wait(.1) do 
    if  Door.Captured == true then
        Objective.Text = "TKR Center"
        --
        pie = (TKR_Defence.Value/TKR_Max_Defence.Value)
        TKR.AbsoluteSize = UDim2.new(pie,0)(1,0)     <-- Changes here  
    end
end
--
while wait(.1) do 
    if  Door.Captured == false then
        Objective.Text = "Door"
        --
        pie2 = (Door_Defence.Value/Door_Max_Defence.Value)
        TKR.AbsoluteSize = UDim2.new(pie2,0)(1,0) <-- Changes here         
    end
end
Ad

Answer this question