Hello! I’m working on an elevator, and i’ve run into an odd issue that I need to resolve.
After we call the elevator we wait 20 seconds for the tween to finish, but nothing after the 20 second wait in the function runs.
I’ve tried changing the wait time, and that’s about it because I can’t think of any other solutions.
function call()
print("Elevator was called!")
wait(5)
upTween:Play()
wait(20)
print("20 seconds is done, doors opening.")
lopenTween:Play()
ropenTween:Play()
print("Doors open!")
wait(10)
print("Doors closing!")
lcloseTween:Play()
rcloseTween:Play()
end
I haven’t experienced any similar issues, so I’m not sure how to tackle this.
Thanks in advance!
if those are tweens
how long do they take?
upTween is set to last 20 seconds, both lopenTween and ropenTween are set to last 4 seconds. The 2 close tweens also last 4 seconds.
Ok, remove wait
and add
tweenName.Completed:Wait()
Alright, I’ll try that real quick.
1 Like
Still nothing after the tween completes.
RMofSBI
(RMofSBI)
May 23, 2022, 12:40am
#7
And nothing prints out either after that tween?
The prints are not running after the tween, I added the prints to see if it would print and it does not.
RMofSBI
(RMofSBI)
May 23, 2022, 12:42am
#9
Try tween:Cancel() after the tween runs. I mean after the wait.
Alright, give me one minute to add that and test it.
Unfortunately this did not work, still no print and the doors don’t open for the player.
RMofSBI
(RMofSBI)
May 23, 2022, 12:47am
#12
Is it somehow on loop when you create it?
If repeatcount is less than zero it will loop indefinitley.
The actual tweenInfo is as follows:
local tweeningInfoUp = TweenInfo.new(
20,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
so It shouldn’t be on loop, and wouldn’t a loop cause it to go back to the position it was at before the tween was called?
1 Like
I found the issue, I’m just dumb I forgot to change the script in the second button to actually open the doors. There is no print in it which is why nothing is printing etc. Sorry for the wasted time I can’t believe I didn’t notice earlier.
Thanks for your time sorry to have wasted it!
1 Like