So, basically I am trying to make a script that will change my gui fan tweens speed. When a player uses the imagebutton/switch, 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(0.25, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)
local tweenInfo2 = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1)
local tweenInfo3 = TweenInfo.new(1, 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)
When I click the imagebutton/switch, the fan slightly reverses back, and the fan stops after the third tween.
robloxapp-20221002-2254270.wmv (372.6 KB)
Help would be much appreciated.