local Input = game:GetService("UserInputService") local player = game:GetService("Players").LocalPlayer local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui")) gui.ResetOnSpawn = false local row = Instance.new("Frame", gui) row.AnchorPoint, row.BackgroundTransparency = Vector2.new(0.5, 1), 1 row.Position, row.Size = UDim2.fromScale(0.5, 0.95), UDim2.fromOffset(220, 48) local layout = Instance.new("UIListLayout", row) layout.FillDirection, layout.Padding = Enum.FillDirection.Horizontal, UDim.new(0, 8) local buttons = {} local function selectSlot(selected) for index, button in buttons do button.BackgroundColor3 = index == selected and Color3.fromRGB(89, 226, 190) or Color3.fromRGB(86, 107, 160) end gui:SetAttribute("SelectedSlot", selected) end for index = 1, 4 do local button = Instance.new("TextButton", row) button.Size, button.Text = UDim2.fromOffset(48, 48), tostring(index) button.Activated:Connect(function() selectSlot(index) end) buttons[index] = button end local keys = {[Enum.KeyCode.One]=1,[Enum.KeyCode.Two]=2,[Enum.KeyCode.Three]=3,[Enum.KeyCode.Four]=4} Input.InputBegan:Connect(function(input, processed) if not processed and keys[input.KeyCode] then selectSlot(keys[input.KeyCode]) end end) selectSlot(1)