Tween wont play second time its fired

local Bar = script.Parent:WaitForChild("Bar")

local IntervalDisplay = script.Parent:WaitForChild("Top"):WaitForChild("IntervalDisplay")

local RS = game:GetService("ReplicatedStorage")

local SetIntervalUI = RS:WaitForChild("RemoteEvents"):WaitForChild("SetIntervalUI")

SetIntervalUI.OnClientEvent:Connect(function(Interval)
print("Fired")
	
	Bar:TweenSize(UDim2.new(0,0,0.025,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Linear,60)

	IntervalDisplay.Text = tostring(Interval)

	task.wait(60)
	
	Bar.Size = UDim2.new(1,0,0.025,0)
	
end)

The tween wont play after the remotevents fires a second time

1 Like

Thats because you wrote “Task.wait(60)”. This means, the screen gui will only reset after a minute.

I wrote the task.wait because we need to wait 60 before the tween stops

TweenName.Completed:wait()

You wrote bar.size and not bar:tweensize?