Is there a way to make a loop wait until something happen before running?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I have an UI and I want it to run a animation when you go into a catogory and there’s a loop script for the order frame, and I want it to wait until the animation is done.
  2. What is the issue? Include screenshots / videos if possible!
    Above.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Tried looking around, didn’t find anything.
while(1) do
	wait()
	script.Parent.Visible = true
end

You can use TweenBase.Completed event in animations created by TweenService.

Other than that you can use BindableEvents to signal when loop for your UI effects is done.

Thank you! Gonna try them out now.

Hello @Dev_Chamy , I’m pretty sure that you can use repeat unti loop to make this possible. Here is the document to repeat until loop: Introduction to Scripting | Documentation - Roblox Creator Hub

As @BenMactavsin said, use TweenBase.Completed for detecting UI tween finish

(Scroll down a bit to see it)

Hope it helps!