im cloning a frame called “ShopItemFrame” from replicated storage and the button exists inside the frame, and im using a remote fuction for the button tween, i dont know how to script it so the tween works after the frame has been cloned in PlayerGui. I tried to apply the tween in PlayerGui directly as its going to be cloned their but i cant seem to get it to work… Any help is appreciated!
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local CategoryContent = PlayerGui.ShopInterface.Holder.Content.CategoryContents.Contents.Limited:WaitForChild("CategoryContent")
-- ShopItemFrame is being cloned from replicated Storage
local ShopItemFrame = CategoryContent:WaitForChild("ShopItemFrame")
local TextButton = ShopItemFrame.Button
TextButton.Activated:Connect(function()
local originalSize = ShopItemFrame.Size
local newSize = originalSize + UDim2.new(-0.05, 0, -0.05, 0)
ShopItemFrame:TweenSize(newSize, Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.05, true)
game.ReplicatedStorage.BuyTrail:FireServer(ShopItemFrame.Name)
wait(0.1)
ShopItemFrame:TweenSize(originalSize, Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.05, true)
end)
You could pre-make this and just not show it until it is to be used. Then it would just be a matter of updating the frame size and showing the button. As in, the button was always there.