Tween speed issues

So, basically I am trying to make a script that will change my gui fan tweens speed. When a player presses a imagebutton, it should change to different speeds, via tweens, with different tweeninfo speeds.

local Fan = script.Parent
local Tween = game:GetService("TweenService")
local Online = script.Parent.Parent.Online
local Offline = script.Parent.Parent.Offline
local S1 = script.Parent.Parent.Switch1
local S2 = script.Parent.Parent.Switch2
local S3 = script.Parent.Parent.Switch3
local Mouse = game:GetService("MouseService")

local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)
local tweenInfo2 = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)
local tweenInfo3 = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)

Fan.Rotation = 0


local tween1 = Tween:Create(Fan, tweenInfo, {Rotation = (360)}):Play()
local tween2 = Tween:Create(Fan, tweenInfo2, {Rotation = (360)})
local tween3 = Tween:Create(Fan, tweenInfo3, {Rotation = (360)})


S1.MouseButton1Click:Connect(function()
	S1.Visible = false
	S2.Visible = true
	tween1:Pause()
	tween2:Play()
end)

S2.MouseButton1Click:Connect(function()
	S2.Visible = false
	S3.Visible = true
	tween2:Pause()
	tween3:Play() 
end)

S3.MouseButton1Click:Connect(function()
	S3.Visible = false
	S1.Visible = true
	tween3:Pause()
	tween1:Play()
end)










                                                                                          

When I use the imagelabel, the tween starts glitching out. Help would be appreciated!

This won’t return a Tween Instance since your calling the :Play function. Maybe try:

local tween1 = Tween:Create(Fan, tweenInfo, {Rotation = (360)})
tween1:Play()
local Fan = script.Parent

local Tween = game:GetService("TweenService")

local Online = script.Parent.Parent.Online

local Offline = script.Parent.Parent.Offline

local S1 = script.Parent.Parent.Switch1

local S2 = script.Parent.Parent.Switch2

local S3 = script.Parent.Parent.Switch3

local Mouse = game:GetService("MouseService")

local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)

local tweenInfo2 = TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)

local tweenInfo3 = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)

Fan.Rotation = 0

local tween1 = Tween:Create(Fan, tweenInfo, {Rotation = (360)})

tween1:Play()

local tween2 = Tween:Create(Fan, tweenInfo2, {Rotation = (360)})

local tween3 = Tween:Create(Fan, tweenInfo3, {Rotation = (360)})

S1.MouseButton1Click:Connect(function()

S1.Visible = false

S2.Visible = true

tween1:Pause()

tween2:Play()

end)

S2.MouseButton1Click:Connect(function()

S2.Visible = false

S3.Visible = true

tween2:Pause()

tween3:Play()

end)

S3.MouseButton1Click:Connect(function()

S3.Visible = false

S1.Visible = true

tween3:Pause()

tween1:Play()

end)

U cant use tween1:Play() or tween1:Pause if a Play() is inside the Variable with local