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

Bar wont move despite the value being setup correctly?

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

1 comment

0

UDim2.new(pie,0,1,0) and UDim2.new(pie2,0,1,0)

1 answer

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

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