Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't the text transparency of my textbox change back to 0 after tween to 1?

Asked by 4 years ago

I made a remote event which fully functions as it's meant to but every time it happens It doesn't change the text transparency back to 0 how it should do. Here is my script:

01local RS = game:GetService("ReplicatedStorage")
02local eventsFolder = RS:WaitForChild("RemoteEvents")
03local xpEvent = eventsFolder:WaitForChild("XpNotify")
04 
05local notifier = script.Parent
06 
07local TweenService = game:GetService("TweenService")
08 
09--//Tweening Information
10local tInfo = TweenInfo.new(1)
11local goal = {}
12goal.TextTransparency = 1
13local tween = TweenService:Create(notifier, tInfo, goal)
14--//Script
15xpEvent.OnClientEvent:Connect(function(xpAmount)
View all 26 lines...

Thank you for your time and I hope you have an answer to this question. Any help is appreciated.

0
I'm not the best at scripting I'm new here, but try using breakpoints to figure out the line that it stops at ArCeMo6 -1 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

Keep in mind, Tweens do not yield the thread until they are done. This means that if you want to wait for the tween to complete, you have to manually add a wait. Since your tween runs for 1 second, you can fix this with a simple

1tween:Play()
2wait(1)

If this answer was helpful, please don't forget to mark as solution, thx c;

Ad
Log in to vote
0
Answered by 4 years ago

Keep in mind, Tweens do not yield the thread until they are done. This means that if you want to wait for the tween to complete, you have to manually add a wait. Since your tween runs for 1 second, you can fix this with a simple

1tween:Play()
2wait(1)

If this answer was helpful, please don't forget to mark as solution, thx c;

Answer this question