local m=InventoryFrame.Main.Weapons local o=m.Actions local c=m.Equipped local h=m.Items local n=o.ActionContainer local p=n.Craft local i=o.Equip local D=o.Craft local v=o.Recycle local S=InventoryFrame.Recipes local O={[h]={[i]={Size=h.Size;Position=h.Position};[D]={Size=UDim2.new(0,-427,1,-155),Position=h.Position},[v]={Size=UDim2.new(0,-427,1,-200),Position=h.Position}};[o]={[i]={Size=o.Size,Position=o.Position};[D]={Size=UDim2.new(1,0,0,160),Position=UDim2.new(0,0,1,-160)},[v]={Size=UDim2.new(1,0,0,205);Position=UDim2.new(0,0,1,-205)}},[c]={[i]={Size=c.Size,Position=c.Position},[D]={Size=UDim2.new(0,130,1,-155);Position=UDim2.new(1,0,0,0)},[v]={Size=UDim2.new(0,130,1,-200),Position=c.Position}},[S]={[i]={Size=S.Size;Position=S.Position};[D]={Size=UDim2.new(0,292,1,-155);Position=S.Position},[v]={Size=UDim2.new(0,0,1,-200),Position=h.Position}}}local Y={i;D,v}local function w(m,o)CurrentAction=m.Name for o,c in pairs(Y)do c.Style=c==m and Enum.ButtonStyle.RobloxRoundDefaultButton or Enum.ButtonStyle.RobloxRoundButton end if m.Name~="\069\113\117\105\112"then for o,c in pairs(n:GetChildren())do c.Visible=c.Name==m.Name end end for c,h in pairs(O)do c:TweenSizeAndPosition(h[m].Size,h[m].Position,Direction,Style,tonumber(o)~=nil and o or Time)end end for m,o in pairs(Y)do o.MouseButton1Click:connect(function()w(o)end)end
-- Weapons Tab
local WeaponsFrame = InventoryFrame.Main.Weapons

local ActionsFrame = WeaponsFrame.Actions
local EquippedFrame = WeaponsFrame.Equipped
local ItemsFrame = WeaponsFrame.Items

local ActionContainer = ActionsFrame.ActionContainer
local CraftingFrame = ActionContainer.Craft

local EquipButton = ActionsFrame.Equip
local CraftButton = ActionsFrame.Craft
local RecycleButton = ActionsFrame.Recycle
local RecipesFrame = InventoryFrame.Recipes

local Sizes = {

	[ItemsFrame] = {
		[EquipButton] = {
			Size = ItemsFrame.Size,
			Position = ItemsFrame.Position,
		},
		[CraftButton] = {
			Size = UDim2.new(0, -427, 1, -155),
			Position = ItemsFrame.Position,
		},
		[RecycleButton] = {
			Size = UDim2.new(0, -427, 1, -200),
			Position = ItemsFrame.Position,
		},
	},

	[ActionsFrame] = {
		[EquipButton] = {
			Size = ActionsFrame.Size,
			Position = ActionsFrame.Position,
		},
		[CraftButton] = {
			Size = UDim2.new(1, 0, 0, 160),
			Position = UDim2.new(0, 0, 1, -160),
		},
		[RecycleButton] = {
			Size = UDim2.new(1, 0, 0, 205),
			Position = UDim2.new(0, 0, 1, -205),
		},
	},

	[EquippedFrame] = {
		[EquipButton] = {
			Size = EquippedFrame.Size,
			Position = EquippedFrame.Position,
		},
		[CraftButton] = {
			Size = UDim2.new(0, 130, 1, -155),
			Position = UDim2.new(1, 0, 0, 0),
		},
		[RecycleButton] = {
			Size = UDim2.new(0, 130, 1, -200),
			Position = EquippedFrame.Position,
		},
	},

	[RecipesFrame] = {
		[EquipButton] = {
			Size = RecipesFrame.Size,
			Position = RecipesFrame.Position,
		},
		[CraftButton] = {
			Size = UDim2.new(0, 292, 1, -155),
			Position = RecipesFrame.Position, --EquippedFrame.Position;
		},
		[RecycleButton] = {
			Size = UDim2.new(0, 0, 1, -200),
			Position = ItemsFrame.Position,
		},
	},
}

local Buttons = { EquipButton, CraftButton, RecycleButton }

local function ChangeAction(Button, CustomTime)
	CurrentAction = Button.Name
	for _, B in pairs(Buttons) do
		B.Style = (B == Button and Enum.ButtonStyle.RobloxRoundDefaultButton) or Enum.ButtonStyle.RobloxRoundButton
	end
	if Button.Name ~= "Equip" then
		for _, F in pairs(ActionContainer:GetChildren()) do
			F.Visible = (F.Name == Button.Name)
		end
	end
	for Frame, Data in pairs(Sizes) do
		Frame:TweenSizeAndPosition(
			Data[Button].Size,
			Data[Button].Position,
			Direction,
			Style,
			((tonumber(CustomTime) ~= nil and CustomTime) or Time)
		)
	end
end
for _, Button in pairs(Buttons) do
	Button.MouseButton1Click:connect(function()
		ChangeAction(Button)
	end)
end
