i am trying to make a tween to pause when a gui is opened and will play again after the gui is closed, the problem is the script wont work and the tween itself wont play (after i put the “if button” script)
local TweenService = game:GetService(“TweenService”)
local Fumo = script.Parent
local button = game.StarterGui.Settings.Scrollinglocal Info = TweenInfo.new(
0.2, --speed
Enum.EasingStyle.Quad, --easing style
Enum.EasingDirection.Out, --easing direction
-1, --repeating (-1 to continue for evah)
true, – repeat?
0) --delay before startlocal Sizee = {Size = Vector3.new(6.003, 5.093, 6.887)}
–no change, -1.300, +1.300local tween = TweenService:Create(Fumo, Info, Sizee)
tween:Play()
if button.Visible == true then
tween:Pause()
elseif button.Visible == false then
tween:Resume()
end