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

how to create a line that will be 1 pixel longer in 1 second?

how can I create it as a part of loading screen? I tryed to create a code for it to it becomes longer at 1 pixel a 1 sec., this is my script and I cant find where is my error:

local loadingScreenLine = LoadingScreenLine -- I named that line as LoadingScreenLine
loadingScreenLine: 1,1,1
loadingScreenLine: 1,1,2
loadingScreenLine: 1,2,2
end

variable names "loadingScreenLine" is a variable I've created to lua can understand about what I need

4 comments

0

maybe you understand

0

Try using vector3

0

@TheReverseGaming, But It's a GUI, it should be Vector2.

0

okay I'll try thanks

1 answer

✓ Accepted answer

Note that in Roblox, we do not use regular Lua.

Firstly, you cannot simply define a variable as "LoadingScreenLine." Remember that you have to do something along the lines of: "game.StarterGui.LoadingScreen.LoadingScreenLine" or simply "script.Parent."

Also, you use UDim2 to change the size of the line. So, you can use a while loop that adds one pixel to the GUI every second.

while true do
	LoadingScreenLine.Size = LoadingScreenLine.Size + UDim2.new(0,1,0,0)
	wait(1)
end

Remember, though, that this only moves one pixel per second, so it would be very, very slow.

1 comment

0

So, a bit under that line, I’ll ad a text “WAIT 100 HOURS”.

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