After doing some research, I have a feeling that it would be something with the .Completed event, but I can't figure out how I would implement that into my game. This is the code that is causing the problem.
I have a feeling it would be something to do with this line, I did try simply waiting 6 seconds and then removing it (Which is what I want to happen to the textLabel when the tween is complete) but adding the 6 second timer just messed with all other parts of my code.
textLabel:TweenPosition(UDim2.new(position, 0, -0.5, 0), nil, nil, 6)
I'll accept your answer if it works. :D
Okay, I have my fixed answer here. The problem was that I needed to access "TweenService" in order to access the event of 'Completed', so I had to change around a few parts of my code. Below, I have my updated code that works, this will, when the GUI has finished tweening, will delete the TextLabel.
local TweenService = game:GetService("TweenService") -- had to use TweenService to access the event of 'Completed' local WordLabel = script.Parent local PositionLabel --Defined earlier on local TweenInfoLabel = TweenInfo.new(3) -- '3' defines the amount of time that the tween takes place in local NewTweenPosition = {} -- has to be a table local NewTweenPosition = UDim2.new(PositionLabel, 0, -0.5, 0) --position I want the GUI to tween to local tweenLabel = TweenService:Create(WordLabel, tweenInfoLabel, NewTweenPosition) -- creating the tween with all parameters tweenLabel.Completed:Connect(function() WordLabel:Remove() -- removes the label when the tween has completed end) TweenLabel:Play() -- plays the tween
I have also added comments onto the sections that I was mainly confused on, which may lead to someone else in the future also being confused.
I hope this helps!