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

How would i detect when a gui tween is done?

So I'm trying to make an animated background for my game menu and i need to detect when the background is done tweening. I tried doing this but it kept erroring:

local Patterntween = script.Parent:TweenPosition(
	
	UDim2.new(0.509, 0,1, 0),
	Enum.EasingDirection.In,
	Enum.EasingStyle.Linear,
	10,
	nil
	
	
)

while true do
	wait()
	if Patterntween.Completed ==  true then
		print("Tween done!")
	end
end

Someone please help!

1 answer

✓ Accepted answer

I think you have to check the status on it, here is the code to fix it.

if Patterntween == Enum.TweenStatus.Completed then
	print("The tween completed uninterrupted")
end

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