Coroutine script not working with tweens

Hello everyone! I am currently making a UI script that will show a custom warning. When I run this script, it seems to work but only up to the point of the tween, then it won’t run past it. Here is the code, please help me if you can.

coroutine.wrap(function()
			local NewUI = UI:Clone()
		
			NewUI.Frame.Position = NewUI.Frame.Position + UDim2.new(0, 0, 0.25, 0)
			NewUI.Parent = Players[P]
			local TweenGoal = {}
			TweenGoal.Position = NewUI.Frame.Position - UDim2.new(0, 0, 0.25, 0)
			local Tween = game:GetService("TweenService"):Create(NewUI, TweenInfo.new(1.25, Enum.EasingStyle.Back), TweenGoal)
			Tween:Play()
			task.wait(1.25)
			NewUI.Frame.Description.Text = Text
		end)()

Nevermind, sorry for bothering you. I figured it out, I forgot to parent the UI to the player’s UI and make the tween move the frame not the UI lol.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.