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

Why is this while loop only running once and then stopping?

Asked by 5 years ago
function floatingtitle()
local float = true

while float == true do
    gui.back.title:TweenPosition(UDim2.new(0.114, 0,-0.151, 0))
    wait(1.1)
    gui.back.title:TweenPosition(UDim2.new(0.114, 0,-0.101, 0))
end
end
wait(0.1)
floatingtitle()

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

It looks like it's running fine. Print something inside the loop to see for yourself. I think what's happening is that your tween isn't stopping for the other tween. I had this issue a while ago and I think you need to change the override property of the tween position function.

0
when i try to do that it says unable to cast bool to token FallenZalio 99 — 5y
0
make sure it's the fifth parameter in the function royaltoe 5144 — 5y
0
now the gui goes up but does not go back down after 1 second. FallenZalio 99 — 5y
View all comments (5 more)
0
do each of them have the override property set to true? royaltoe 5144 — 5y
0
yes FallenZalio 99 — 5y
0
i fixed by adding another wait after the second tween function. thanks for helping FallenZalio 99 — 5y
0
can you update your post to what the code looks like rn royaltoe 5144 — 5y
0
alright good to know royaltoe 5144 — 5y
Ad

Answer this question