local s=(game:GetService("\080\108\097\121\101\114\115")).LocalPlayer;(game:GetService("\083\116\097\114\116\101\114\071\117\105")):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)local P=(game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).hotbarTemplate local m=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local T=s.Character or s.CharacterAdded:Wait()function getToolAmt()local P=0 local m,w,r=pairs(T:GetChildren())while true do local s,T=m(w,r)if s then else break end r=s if T:IsA("\084\111\111\108")then P=P+1 end end local v,G,X=pairs(s.Backpack:GetChildren())while true do local s,m=v(G,X)if s then else break end X=s if m:IsA("\084\111\111\108")then P=P+1 end end return P end local w={[Enum.KeyCode.One]=Enum.KeyCode.One,[Enum.KeyCode.Two]=Enum.KeyCode.Two;[Enum.KeyCode.Three]=Enum.KeyCode.Three,[Enum.KeyCode.Four]=Enum.KeyCode.Four;[Enum.KeyCode.Five]=Enum.KeyCode.Five;[Enum.KeyCode.Six]=Enum.KeyCode.Six,[Enum.KeyCode.Seven]=Enum.KeyCode.Seven;[Enum.KeyCode.Eight]=Enum.KeyCode.Eight,[Enum.KeyCode.Nine]=Enum.KeyCode.Nine,[Enum.KeyCode.Zero]=Enum.KeyCode.Zero}local r=s.PlayerGui.MainUI.Hotbar if not r then local P=script.Hotbar:Clone()P=s.PlayerGui.MainUI r=P end local v={"\079\110\101","\084\119\111","\084\104\114\101\101";"\070\111\117\114","\070\105\118\101";"\083\105\120","\083\101\118\101\110","\069\105\103\104\116","\078\105\110\101","\090\101\114\111"};(game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")).InputBegan:Connect(function(P,m)if m then return end if w[P.KeyCode]then for m,T in pairs(r:GetChildren())do if T:IsA("\084\101\120\116\066\117\116\116\111\110")and P.KeyCode==Enum.KeyCode[v[tonumber(T.SlotNum.Text)]]then script.Parent.EquipTool:FireServer(s.Backpack:FindFirstChild(T.Name)or game.Players.LocalPlayer.Character:FindFirstChild(T.Name))end end end end)function addToolToHotbar(m)local T=P:Clone()T.Name=m.Name T.Parent=r T.Tool.Image=m.TextureId or"\114\098\120\097\115\115\101\116\105\100\058\047\047\048"T.SlotNum.Text=tostring(getToolAmt())T.MouseButton1Click:Connect(function()script.Parent.EquipTool:FireServer(s.Backpack:FindFirstChild(m.Name)or game.Players.LocalPlayer.Character:FindFirstChild(m.Name))end)r.Size=r.Size+UDim2.new(.25,0,0,0)end for P,T in pairs(s.Backpack:GetChildren())do if T:IsA("\084\111\111\108")then if not r:FindFirstChild(T.Name)then addToolToHotbar(T)else local P=0 local w={}for s,m in pairs(s.Backpack:GetChildren())do if m.Name==T.Name then P=P+1 table.insert(w,m)end end for s,m in pairs((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).PlayerStorage:GetChildren())do if m.Name==T.Name then P=P+1 end end if P>1 then r[T.Name].DurabilityNumber.Visible=true r[T.Name].DurabilityNumber.Text="\120"..tostring(P)wait(0)w[1].Parent=(game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).PlayerStorage else r[T.Name].UIStroke.Transparency=.7;(m:Create(r[T.Name],TweenInfo.new(.1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Size=UDim2.new(.8,0,.8,0)})):Play()end end end end s.Backpack.ChildAdded:Connect(function(P)if P:IsA("\084\111\111\108")then if not r:FindFirstChild(P.Name)then addToolToHotbar(P)return end local T=0 local w={}for s,m in pairs(s.Backpack:GetChildren())do if m.Name==P.Name then T=T+1 table.insert(w,m)end end for s,m in pairs((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).PlayerStorage:GetChildren())do if m.Name==P.Name then T=T+1 end end if T>1 then r[P.Name].DurabilityNumber.Visible=true r[P.Name].DurabilityNumber.Text="\120"..tostring(T)wait(0)w[1].Parent=(game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).PlayerStorage return else r[P.Name].UIStroke.Transparency=.7;(m:Create(r[P.Name],TweenInfo.new(.1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Size=UDim2.new(.8,0,.8,0)})):Play()end end end)s.Character.ChildAdded:Connect(function(s)if s:IsA("\084\111\111\108")then if not r:FindFirstChild(s.Name)then addToolToHotbar(s)end local P=r[s.Name]P.UIStroke.Transparency=0;(m:Create(P,TweenInfo.new(.1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{Size=UDim2.new(1,0,1,0)})):Play()end end)s.Character.ChildRemoved:Connect(function(P)if P:IsA("\084\111\111\108")and(P.Parent~=s.Backpack and(P.Parent~=(game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).PlayerStorage and r:FindFirstChild(P.Name)))then local m=tonumber(string.sub(r[P.Name].DurabilityNumber.Text,2,2))if r[P.Name].DurabilityNumber.Visible and m>1 then r[P.Name].DurabilityNumber.Text="\120"..tostring(m-1)if r[P.Name].DurabilityNumber.Text=="\120\049"then r[P.Name].DurabilityNumber.Visible=false end;((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).PlayerStorage:FindFirstChild(P.Name)).Parent=s.Character return end r[P.Name]:Destroy()r.Size=r.Size-UDim2.new(.25,0,0,0)local T=1 for s,P in pairs(r:GetChildren())do if P:IsA("\084\101\120\116\066\117\116\116\111\110")then P.SlotNum.Text=tostring(T)T=T+1 end end end end)
-- Decompiled with the Synapse X Luau decompiler.

local l__LocalPlayer__1 = game:GetService("Players").LocalPlayer
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
local l__hotbarTemplate__2 = game:GetService("ReplicatedStorage").hotbarTemplate
local l__TweenService__3 = game:GetService("TweenService")
local u1 = l__LocalPlayer__1.Character or l__LocalPlayer__1.CharacterAdded:Wait()
function getToolAmt()
	local v4 = 0
	local v5, v6, v7 = pairs(u1:GetChildren())
	while true do
		local v8, v9 = v5(v6, v7)
		if v8 then
		else
			break
		end
		v7 = v8
		if v9:IsA("Tool") then
			v4 = v4 + 1
		end
	end
	local v10, v11, v12 = pairs(l__LocalPlayer__1.Backpack:GetChildren())
	while true do
		local v13, v14 = v10(v11, v12)
		if v13 then
		else
			break
		end
		v12 = v13
		if v14:IsA("Tool") then
			v4 = v4 + 1
		end
	end
	return v4
end
local u2 = {
	[Enum.KeyCode.One] = Enum.KeyCode.One,
	[Enum.KeyCode.Two] = Enum.KeyCode.Two,
	[Enum.KeyCode.Three] = Enum.KeyCode.Three,
	[Enum.KeyCode.Four] = Enum.KeyCode.Four,
	[Enum.KeyCode.Five] = Enum.KeyCode.Five,
	[Enum.KeyCode.Six] = Enum.KeyCode.Six,
	[Enum.KeyCode.Seven] = Enum.KeyCode.Seven,
	[Enum.KeyCode.Eight] = Enum.KeyCode.Eight,
	[Enum.KeyCode.Nine] = Enum.KeyCode.Nine,
	[Enum.KeyCode.Zero] = Enum.KeyCode.Zero,
}
local l__Hotbar__3 = l__LocalPlayer__1.PlayerGui.MainUI.Hotbar
if not l__Hotbar__3 then
	local hotbar = script.Hotbar:Clone()
	hotbar = l__LocalPlayer__1.PlayerGui.MainUI
	l__Hotbar__3 = hotbar
end
local u4 = { "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero" }
game:GetService("UserInputService").InputBegan:Connect(function(p1, p2)
	if p2 then
		return
	end
	if u2[p1.KeyCode] then
		for v15, v16 in pairs(l__Hotbar__3:GetChildren()) do
			if v16:IsA("TextButton") and p1.KeyCode == Enum.KeyCode[u4[tonumber(v16.SlotNum.Text)]] then
				script.Parent.EquipTool:FireServer(
					l__LocalPlayer__1.Backpack:FindFirstChild(v16.Name)
						or game.Players.LocalPlayer.Character:FindFirstChild(v16.Name)
				)
			end
		end
	end
end)
function addToolToHotbar(p3)
	local v17 = l__hotbarTemplate__2:Clone()
	v17.Name = p3.Name
	v17.Parent = l__Hotbar__3
	v17.Tool.Image = p3.TextureId or "rbxassetid://0"
	v17.SlotNum.Text = tostring(getToolAmt())
	v17.MouseButton1Click:Connect(function()
		script.Parent.EquipTool:FireServer(
			l__LocalPlayer__1.Backpack:FindFirstChild(p3.Name)
				or game.Players.LocalPlayer.Character:FindFirstChild(p3.Name)
		)
	end)
	l__Hotbar__3.Size = l__Hotbar__3.Size + UDim2.new(0.25, 0, 0, 0)
end
for v18, v19 in pairs(l__LocalPlayer__1.Backpack:GetChildren()) do
	if v19:IsA("Tool") then
		if not l__Hotbar__3:FindFirstChild(v19.Name) then
			addToolToHotbar(v19)
		else
			local v20 = 0
			local v21 = {}
			for v22, v23 in pairs(l__LocalPlayer__1.Backpack:GetChildren()) do
				if v23.Name == v19.Name then
					v20 = v20 + 1
					table.insert(v21, v23)
				end
			end
			for v24, v25 in pairs(game:GetService("ReplicatedStorage").PlayerStorage:GetChildren()) do
				if v25.Name == v19.Name then
					v20 = v20 + 1
				end
			end
			if v20 > 1 then
				l__Hotbar__3[v19.Name].DurabilityNumber.Visible = true
				l__Hotbar__3[v19.Name].DurabilityNumber.Text = "x" .. tostring(v20)
				wait(0)
				v21[1].Parent = game:GetService("ReplicatedStorage").PlayerStorage
			else
				l__Hotbar__3[v19.Name].UIStroke.Transparency = 0.7
				l__TweenService__3
					:Create(
						l__Hotbar__3[v19.Name],
						TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut),
						{
							Size = UDim2.new(0.8, 0, 0.8, 0),
						}
					)
					:Play()
			end
		end
	end
end
l__LocalPlayer__1.Backpack.ChildAdded:Connect(function(p4)
	if p4:IsA("Tool") then
		if not l__Hotbar__3:FindFirstChild(p4.Name) then
			addToolToHotbar(p4)
			return
		end
		local v26 = 0
		local v27 = {}
		for v28, v29 in pairs(l__LocalPlayer__1.Backpack:GetChildren()) do
			if v29.Name == p4.Name then
				v26 = v26 + 1
				table.insert(v27, v29)
			end
		end
		for v30, v31 in pairs(game:GetService("ReplicatedStorage").PlayerStorage:GetChildren()) do
			if v31.Name == p4.Name then
				v26 = v26 + 1
			end
		end
		if v26 > 1 then
			l__Hotbar__3[p4.Name].DurabilityNumber.Visible = true
			l__Hotbar__3[p4.Name].DurabilityNumber.Text = "x" .. tostring(v26)
			wait(0)
			v27[1].Parent = game:GetService("ReplicatedStorage").PlayerStorage
			return
		else
			l__Hotbar__3[p4.Name].UIStroke.Transparency = 0.7
			l__TweenService__3
				:Create(l__Hotbar__3[p4.Name], TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
					Size = UDim2.new(0.8, 0, 0.8, 0),
				})
				:Play()
		end
	end
end)
l__LocalPlayer__1.Character.ChildAdded:Connect(function(p5)
	if p5:IsA("Tool") then
		if not l__Hotbar__3:FindFirstChild(p5.Name) then
			addToolToHotbar(p5)
		end
		local v32 = l__Hotbar__3[p5.Name]
		v32.UIStroke.Transparency = 0
		l__TweenService__3
			:Create(v32, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
				Size = UDim2.new(1, 0, 1, 0),
			})
			:Play()
	end
end)
l__LocalPlayer__1.Character.ChildRemoved:Connect(function(p6)
	if
		p6:IsA("Tool")
		and p6.Parent ~= l__LocalPlayer__1.Backpack
		and p6.Parent ~= game:GetService("ReplicatedStorage").PlayerStorage
		and l__Hotbar__3:FindFirstChild(p6.Name)
	then
		local v33 = tonumber(string.sub(l__Hotbar__3[p6.Name].DurabilityNumber.Text, 2, 2))
		if l__Hotbar__3[p6.Name].DurabilityNumber.Visible and v33 > 1 then
			l__Hotbar__3[p6.Name].DurabilityNumber.Text = "x" .. tostring(v33 - 1)
			if l__Hotbar__3[p6.Name].DurabilityNumber.Text == "x1" then
				l__Hotbar__3[p6.Name].DurabilityNumber.Visible = false
			end
			game:GetService("ReplicatedStorage").PlayerStorage:FindFirstChild(p6.Name).Parent =
				l__LocalPlayer__1.Character
			return
		end
		l__Hotbar__3[p6.Name]:Destroy()
		l__Hotbar__3.Size = l__Hotbar__3.Size - UDim2.new(0.25, 0, 0, 0)
		local v34 = 1
		for v35, v36 in pairs(l__Hotbar__3:GetChildren()) do
			if v36:IsA("TextButton") then
				v36.SlotNum.Text = tostring(v34)
				v34 = v34 + 1
			end
		end
	end
end)
