Help: Tweening frame downgrade but it going to upgrade

In the button:

local rep = game:GetService("ReplicatedStorage")
local guianimationsModule = require(rep.UI.GUIAnimations)
local tweened = false

script.Parent.MouseButton1Down:Connect(function()
	guianimationsModule.Test(script.Parent.Parent.Frame)
end)

In the module:

local AnimationModule = {}

local originalFramePos

AnimationModule.Down = function(thing: Frame)
	originalFramePos = thing.Position
	thing:TweenPosition(UDim2.new(0.732, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
	wait(1)
	thing.Visible = false
	print("yayayy")
end

AnimationModule.Up = function(thing: Frame)
	thing.Visible = true
	thing:TweenPosition(originalFramePos, Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
	print("yayayy")
end

AnimationModule.AnimateFrame = function(thing: Frame)
	if thing.Visible then
		originalFramePos = thing.Position
		thing:TweenPosition(UDim2.new(0.732, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
		wait(1)
		thing.Visible = false
		print("disabled")
	else
		thing.Visible = true
		thing:TweenPosition(originalFramePos, Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
		print("enabled")
	end
end

AnimationModule.Test = function(thing: Frame)
	if thing.Visible then
		originalFramePos = thing.Position
		thing:TweenPosition(UDim2.new(originalFramePos.X, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
		wait(1)
		thing.Visible = false
		print("disabled")
	else
		thing.Visible = true
		thing:TweenPosition(originalFramePos, Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
		print("enabled")
	end
end




return AnimationModule

It going to upgrade not downgrade

Can someone help me pls?

I want it to be like this:


In that line:

AnimationModule.Test = function(thing: Frame)
	if thing.Visible then
		originalFramePos = thing.Position
		thing:TweenPosition(UDim2.new(originalFramePos.X, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
		wait(1)
		thing.Visible = false
		print("disabled")
	else
		thing.Visible = true
		thing:TweenPosition(originalFramePos, Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1, false)
		print("enabled")
	end
end

It going to upgrade not downgrade so I want it going to downgrade

You have to do -1, so it goes down, including the function .Test + wrong category, it’s supposed to be #help-and-feedback:scripting-support

1 Like

Thank you so much:)

[Bro I hate limited characters]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.