# table(ロブロックス ライブラリ) > テーブル(配列や辞書)を扱うためのライブラリです。値の追加・削除・並べかえなどができます。 - URL:https://roblox.minecraft-okinawa.com/reference/libraries/table/ - 公式:https://create.roblox.com/docs/reference/engine/libraries/table ## 使用例:配列を使う (Script/置く場所:ServerScriptService) ```lua local fruits = { "りんご", "バナナ", "みかん" } print(fruits[1]) table.insert(fruits, "ぶどう") print(#fruits) for index, fruit in ipairs(fruits) do print(index, fruit) end ``` ## 関数 - `table.clear(table: table): ()`:テーブルを空にします。 - `table.clone(t: table): table`:テーブルを複製します。 - `table.concat(t: Array, sep: string, i: int, j: int): string`:配列の値を文字列としてつなげます。 - `table.create(count: number, value: Variant): table`:Returns a new table populated with many instances of the specified value. - `table.find(haystack: table, needle: Variant, init: number): Variant`:値を探して、その番号を返します。 - `table.freeze(t: table): table`:Makes the given table read-only. - `table.insert(t: Array, pos: number, value: Variant): ()`:テーブルに値を追加します。 - `table.insert(t: Array, value: Variant): ()`:テーブルに値を追加します。 - `table.isfrozen(t: table): bool`:Returns true if the given table is frozen and false if it isn't frozen. - `table.maxn(t: table): number`:Returns the maximum numeric key of the provided table, or zero if the table has no numeric keys. - `table.move(src: table, a: number, b: number, t: number, dst: table): table`:Copies the specified range of elements from one table to another. - `table.pack(values...: Variant): Variant`:Returns a new table containing the provided values. - `table.remove(t: Array, pos: number): Variant`:テーブルから値を取り除いて返します。 - `table.sort(t: Array, comp: function): ()`:テーブルを並べかえます。 - `table.unpack(list: table, i: number, j: number): Tuple`:Returns all elements from the given list as a tuple. 英語の説明とメンバー一覧:Roblox Creator Documentation(CC BY 4.0)。日本語の解説はこのサイト独自のものです。 執筆:鈴木孝昌(現役プロジェクトマネージャー/プログラミング講師)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)