I'm trying to tween a Frame. However, when I was testing it only the button changed and the Frame did not move. Is there a problem in the script below? (This is a local script)
local frame = game.StarterGui.FrameGui.Frame local button = script.Parent local toggle = false script.Parent.MouseButton1Click:connect(function() if toggle == false then toggle = true frame:TweenPosition(UDim2.new(0.25,-50,0.4,-50),'Out','Quad',1) script.Parent.Text = 'Close Shop' else toggle = false frame:TweenPosition(UDim2.new(0.25,-50,1.4,-50), 'In', 'Quad',1) script.Parent.Text = 'Open Shop' end end)
The problem is your linking to the frame in the StarterGui, you need to link to the frame which is the parent of the button.
local frame = script.Parent.Parent -- I'm guessing the frame is the button's parent...? local button = script.Parent local toggle = false script.Parent.MouseButton1Click:connect(function() if toggle == false then toggle = true frame:TweenPosition(UDim2.new(0.25,-50,0.4,-50),'Out','Quad',1) script.Parent.Text = 'Close Shop' else toggle = false frame:TweenPosition(UDim2.new(0.25,-50,1.4,-50), 'In', 'Quad',1) script.Parent.Text = 'Open Shop' end end)