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:
01 | local RS = game:GetService( "ReplicatedStorage" ) |
02 | local eventsFolder = RS:WaitForChild( "RemoteEvents" ) |
03 | local xpEvent = eventsFolder:WaitForChild( "XpNotify" ) |
04 |
05 | local notifier = script.Parent |
06 |
07 | local TweenService = game:GetService( "TweenService" ) |
08 |
09 | --//Tweening Information |
10 | local tInfo = TweenInfo.new( 1 ) |
11 | local goal = { } |
12 | goal.TextTransparency = 1 |
13 | local tween = TweenService:Create(notifier, tInfo, goal) |
14 | --//Script |
15 | xpEvent.OnClientEvent:Connect( function (xpAmount) |
Thank you for your time and I hope you have an answer to this question. Any help is appreciated.
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
1 | tween:Play() |
2 | wait( 1 ) |
If this answer was helpful, please don't forget to mark as solution, thx c;
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
1 | tween:Play() |
2 | wait( 1 ) |
If this answer was helpful, please don't forget to mark as solution, thx c;