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

Red bar won't move?

This seems so simple but I have never made a thing where the text grows. What this script down below is spouse to do and grow the red bar (TextLabel with 0.5 transparency red background color with no words) by 5 every 5 seconds.

while true do 
	wait(5)
	script.Parent.Size={0, 5},{0, 50}
	wait(5)
	script.Parent.Size={0, 10},{0, 50}
	wait(5)
	script.Parent.Size={0, 15},{0, 50}
	wait(5)
	script.Parent.Size={0, 20},{0, 50}
	wait(5)
	script.Parent.Size={0, 25},{0, 50}
	wait(5)
	script.Parent.Size={0, 30},{0, 50}
	wait(5)
	script.Parent.Size={0, 35},{0, 50}
	wait(5)
	script.Parent.Size={0, 40},{0, 50}
	wait(5)
	script.Parent.Size={0, 45},{0, 50}
	wait(5)
	script.Parent.Size={0, 50},{0, 50}
	wait(5)
	script.Parent.Size={0, 55},{0, 50}
end

1 answer

✓ Accepted answer

You can't just copy the things that you see from the Properties tab into your script (unfortunately).

.Size in this case is a UDim2 value. If you look up UDim2 on the Wiki:

wiki.roblox.com/index.php?title=UDim2

You will see this constructor

Constructor / Description

UDim2.new(XScale, XOffset, YScale, YOffset) / Creates a new UDim2

i.e. you want to do

script.Parent.Size = UDim2.new(0, 25, 0, 50)

But, don't repeat yourself! Use a loop to do incremental changes like this.

while true do
	for width = 5, 55, 5 do
		wait(5)
		script.Parent.Size = UDim2.new(0, width, 0, 50)
	end
end

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