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

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

Asked by 4 years ago
Edited 4 years ago

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

0
maybe you understand youuuuuuuiiii 44 — 4y
0
Try using vector3 TheReverseGaming 29 — 4y
0
@TheReverseGaming, But It's a GUI, it should be Vector2. Recrucity 13 — 4y
0
okay I'll try thanks youuuuuuuiiii 44 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

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.

0
So, a bit under that line, I’ll ad a text “WAIT 100 HOURS”. youuuuuuuiiii 44 — 3y
Ad

Answer this question