Hello! I am making a UI asset to sell. The UI uses UIList. However, once I parent it to the ReplicatedStorage, the UI of course would be messed so I tried to assign the UI position to its Absolute Position but the property is read only. Is there another way to do this?
local ts = game:GetService("TweenService")
local info = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut) -- Changeble (Time, EasingStyle, EasingDirection)
local Gui = script.Parent
local MainFrame = Gui.MainFrame
local UILISTLAYOUT = MainFrame.UIListLayout
local PlayButton = MainFrame.PlayButton
local SettingButton = MainFrame.SettingButton
local Settings = {
["Gui Position Tweens"] = true; -- Animate gui once it's clicked, set true if yes, set false if no
["Settings Button"] = true -- Allows the settings button to be visible, set true if yes, set false if no
}
PlayButton.MouseButton1Down:Connect(function()
if Settings["Gui Position Tweens"] then
for i, Buttons in pairs(MainFrame:GetChildren()) do
if Buttons:IsA("TextButton") or Buttons:IsA("ImageButton") then
local ButtonPosX = Buttons.Position.X
local ButtonPosY = Buttons.Position.Y
local Absolute = Buttons.AbsolutePosition
UILISTLAYOUT.Parent = game.ReplicatedStorage
Buttons.AbsolutePosition = Vector2.new(Absolute.X, Absolute.Y)
local Animate = 200 --Don't change
task.wait(3)
ts:Create(Buttons, info, {Position = UDim2.new(Buttons.Position.X.Scale, ButtonPosX.Offset - Animate, Buttons.Position.Y.Scale, ButtonPosY.Offset)}):Play()
end
--Gui.Enabled = not Gui.Enabled
end
else
Gui.Enabled = not Gui.Enabled
end
end)