Pish85
(rip_Zephyr)
August 29, 2024, 2:02am
#1
Alright. I wanted to make a tween, and when it ends, wait 4 seconds, do something else. Here’s my code:
local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 0, false, 0)
local goal = {Position = UDim2.new(0.5, 0, 0.25, 0)}
local tween = tweenService:Create(popup, tweenInfo, goal)
tween:Play()
tween.Ended:Wait(4)
However, when I run it, I get an error
Ended is not a valid member of Tween “Tween”
Anyone know a fix?
2112Jay
(2112Jay)
August 29, 2024, 2:07am
#2
tween:Play()
tween.Completed:Wait()
task.wait(4)
1 Like
DonChotte
(SupremoJethro2)
August 30, 2024, 2:30pm
#3
Explanation:
The tween.Ended:Wait()
function waits for the event to fire and pause the script until the event gets triggered and after it fires, it returns the arguments.
Now, this CANNOT be treated as a wait(number)
function and has to be done on a seperate line in order to function as a wait(4)
. like for instance:
tween:Play()
tween.Completed:Wait()
task.wait(4)
print("tweening completed")
This was already solved by @2112Jay .
1 Like
system
(system)
Closed
September 13, 2024, 2:31pm
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.