Looking for someone who is decent on rlua (Roblox Lua) language.
Situation:
I’m currently beginning to experiment UI frameworks in Roblox Studio. I made a LocalScript which consist to open an UI Frame via the usage of a TextButton. The LocalScript includes tweening (easing) styles for it to come on the visual side of the screen smoothly rather than just a simple visibility script that acts as a popup. So, I’ve succeeded into making it come onscreen but I can’t figure out on how to make it go back offscreen with the similar styles.
Here is the original script that acts as “the opening of the UI Frame”:
OpenScript
local Inventory = script.Parent.Inventory
local OpenFrame = script.Parent.OpenFrame
OpenFrame.MouseButton1Up:Connect(function()
-- Opens Inventory
Inventory:TweenPosition(
UDim2.new(0.207, 0, 0.144, 0), -- End Position
"Out", -- Easing Direction
"Quad", -- Easing Style
1, -- Time in seconds
false -- Override any other tweens
)
end)
And here is the script that is supposed to close it but doesn’t work for some reasons:
CloseScript
local Inventory = script.Parent.Inventory
local CloseButton = script.Parent.CloseButton
CloseButton.MouseButton1Up:Connect(function()
-- Closes Inventory
Inventory:TweenPosition(
UDim2.new(0.207, 0, -0.669, 0), -- End Position
"Out", -- Easing Direction
"Quad", -- Easing Style
1, -- Time in seconds
false -- Override any other tweens
)
end)
As you can see on the second one only the end position is different. I thought I would keep it the same but just change directions to the actual starting ones. If you intend into helping me could you tell me where was my mistake?
