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:
local RS = game:GetService("ReplicatedStorage") local eventsFolder = RS:WaitForChild("RemoteEvents") local xpEvent = eventsFolder:WaitForChild("XpNotify") local notifier = script.Parent local TweenService = game:GetService("TweenService") --//Tweening Information local tInfo = TweenInfo.new(1) local goal = {} goal.TextTransparency = 1 local tween = TweenService:Create(notifier, tInfo, goal) --//Script xpEvent.OnClientEvent:Connect(function(xpAmount) print(xpAmount.."xp gained by ".. game.Players.LocalPlayer.Name) --//Prints notifier.Text = tostring(xpAmount) notifier:TweenPosition(UDim2.new(1, 0,-0.829, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.5) wait(1) tween:Play() notifier.Position = UDim2.new(0.25, 0,-0.829, 0) repeat notifier.TextTransparency = 0 --//Fsr doesn't change it back. until notifier.TextTransparency print("XP transition DONE!!") --//Prints end)
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
tween:Play() 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
tween:Play() wait(1)
If this answer was helpful, please don't forget to mark as solution, thx c;