Heres the script if you wanna take a look at it and try to find the problem thats causing the LAST end) to make an error.


local Frame = script.Parent.Frame
local Box = Frame.Box

local Animate = function(Frame, EndPos, EndSize, Direction, Style, Time, OR, Type)
	if Type == "Position" then
		return Frame:TweenPosition(EndPos, Direction, Style, Time, OR)
	elseif Type == "Size" then
		return Frame:TweenSize(EndSize, Direction, Style, Time, OR)
	elseif Type == "SizeAndPosition" then
		return Frame:TweenSizeAndPosition(EndPos, EndSize, Direction, Style, Time, OR)
	end
end

local player = game.Players.LocalPlayer
local Mouse = player:GetMouse() 

Mouse.KeyDown:connect(function(key)
if key == "f" then
Box.Position = UDim2.new(-2,0,0,0)
Animate(Box,UDim2.new(0.150,0,0,0), UDim2.new(0.25, 0, 0.25, 0), "Out", "Back", 2, true, "Position")
end
end
end)