エモートは、あらゆるソーシャルゲームのコアコンポーネントです。EmoteBar 開発者モジュールは、プレイヤーが意味のある社会的交流を促進するためのアクセスしやすくカスタマイズ可能な方法を提供することを目的としています。
モジュールの使用法
インストール
ゲームでEmoteBarモジュールを使用するには:
スタジオのウィンドウメニューまたはホームタブツールバーから、ツールボックスを開き、クリエイターストアタブを選択します。

モデルのソートが選択されていることを確認し、カテゴリのすべて表示ボタンをクリックします。

パッケージタイルを見つけてクリックします。
エモートバーモジュールを見つけてクリックするか、3Dビューにドラッグアンドドロップします。

エクスプローラーウィンドウで、全体のEmoteBarモデルをReplicatedStorageに移動します。ゲームを実行すると、モジュールが実行され始めます。
設定
このモジュールは7つのエモートで事前設定されており、独自のエモートや表示オプションで簡単にカスタマイズできます。さらに、プレイヤーがLil Nas X、Royal Blood、Twenty One Pilotsなどの以前のRobloxイベントからエモートを所有している場合、それらのエモートは自動的に利用可能なエモートのリストに追加されます。
ServerScriptService内に新しいScriptを作成し、名前をConfigureEmotesに変更します。

新しいConfigureEmotesスクリプトに次のコードを貼り付けます。useDefaultEmotes設定をfalseにすると、デフォルトのエモートがオーバーライドされ、setEmotes関数を介してカスタムエモートを定義できます。
Script - ConfigureEmoteslocal ReplicatedStorage = game:GetService("ReplicatedStorage")local EmoteBar = require(ReplicatedStorage.EmoteBar)EmoteBar.configureServer({useDefaultEmotes = false,})EmoteBar.setEmotes({{name = "Hello",animation = "rbxassetid://3344650532",image = "rbxassetid://7719817462",defaultTempo = 1,},{name = "Applaud",animation = "rbxassetid://5915693819",image = "rbxassetid://7720292217",defaultTempo = 2,},})
メガエモート
メガエモートは、同じエリアにいる複数のプレイヤーが同時に同じエモートを実行することで形成されます。プレイヤーが参加するにつれて、メガエモートは大きくなります。プレイヤーがエモートの実行をやめると、メガエモートは小さくなり、最終的には消えます。

テンポ
エモートのテンポは、ボタンが1回タップされたときに再生される速度です。エモートのデフォルト速度はそのdefaultTempoによって決まります。エモートの速度は、ボタンをより早くまたは遅くタップすることで増加または減少させることができます。
APIリファレンス
タイプ
エモート
各エモートは、次のキーと値のペアを持つ辞書で表されます:
| キー | タイプ | 説明 |
|---|---|---|
| name | string | エモート名、例えば"Shrug"。 |
| animation | string | エモートのアニメーションのアセットID。 |
| image | string | GUI内のエモートの画像のアセットID。 |
| defaultTempo | number | エモートアニメーションを再生するデフォルトの速度係数。例えば、テンポが2の場合、アニメーションは通常の2倍の速度で再生されます。0より大きくなければなりません。 |
| isLocked | bool | エモートがアクティブ化できない「ロック」状態かどうか。 |
列挙型
EmoteBar.GuiType
| 名前 | 概要 |
|---|---|
| EmoteBar | エモートが画面の下部にバーとして表示され、個々の「ページ」に分かれているデフォルトの形式。 |
| EmoteWheel | プレイヤーが自分のキャラクターをクリックまたはタップしたときにエモートがリング状に表示されるバリアント。 |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.configureClient({
guiType = EmoteBar.GuiType.EmoteWheel,
})関数
configureServer
configureServer(config: table)
configテーブル内の次のキー/値を介してデフォルトのサーバー側設定オプションをオーバーライドします。この関数はScriptからのみ呼び出すことができ、変更はすべてのクライアントに自動的に複製されます。
| キー | 説明 | デフォルト |
|---|---|---|
| useDefaultEmotes | 提供されたデフォルトのエモートが含まれているかどうか。 | true |
| useMegaEmotes | メガエモート機能を有効または無効にします。 | true |
| emoteMinPlayers | メガエモートに貢献するために同じエモートを実行している最小プレイヤー数。 | 3 |
| emoteMaxPlayers | メガエモートに貢献するために同じエモートを実行している最大プレイヤー数。 | 50 |
| playParticles | プレイヤーが頭上に浮かぶ粒子として再生しているエモートを有効または無効にします。 | true |
| sendContributingEmotes | メガエモートに貢献するために小さなエモートアイコンを送信することを有効または無効にします。 | true |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.configureServer({
emoteMinPlayers = 2,
playParticles = false,
})configureClient
configureClient(config: table)
configテーブル内の次のキー/値を介してデフォルトのクライアント側設定オプションをオーバーライドします。この関数はLocalScriptからのみ呼び出すことができます。guiTypeの値に応じて、注記されたタブのオプションも適用されます。
| キー | 説明 | デフォルト |
|---|---|---|
| guiType | エモートを表示するためのGUIの形式を制御します(EmoteBar.GuiType)。 | EmoteBar |
| useTempo | ユーザーが同じエモートをリズミカルに繰り返しアクティブ化することで、エモートの再生速度を制御できるテンポ機能を有効または無効にします。 | true |
| tempoActivationWindow | エモートの連続アクティブ化の間にユーザーが持つ時間(秒単位)。 | 3 |
| lockedImage | ロックされたエモートの上に表示する画像。 | "rbxassetid://6905802778" |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.configureClient({
guiType = EmoteBar.GuiType.EmoteBar,
maxEmotesPerPage = 6,
nextPageKey = Enum.KeyCode.Z,
prevPageKey = Enum.KeyCode.C,
})local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.configureClient({
guiType = EmoteBar.GuiType.EmoteWheel,
})setEmotes
setEmotes(emotes: table)
使用するカスタムエモートを設定します。useDefaultEmotesがtrueの場合、これらはデフォルトに追加され、useDefaultEmotesがfalseの場合、デフォルトを置き換えます。この関数はScriptからのみ呼び出すことができ、変更はすべてのクライアントに自動的に複製されます。
この関数に渡される各エモートの構造についてはエモートを参照してください。
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.configureServer({
useDefaultEmotes = false,
})
EmoteBar.setEmotes({
{
name = "Hello",
animation = "rbxassetid://3344650532",
image = "rbxassetid://7719817462",
defaultTempo = 1,
},
{
name = "Applaud",
animation = "rbxassetid://5915693819",
image = "rbxassetid://7720292217",
defaultTempo = 2,
},
})setGuiVisibility
setGuiVisibility(visible: boolean)
エモートGUIを表示または非表示にします。この関数は特定のクライアントのLocalScriptからのみ呼び出すことができます。
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.setGuiVisibility(false)getEmote
名前でエモートを取得します。エモートが見つからない場合はnilを返します。この関数は特定のクライアントのLocalScriptからのみ呼び出すことができます。
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
local shrug = EmoteBar.getEmote("Shrug")playEmote
playEmote(emote: エモート)
指定されたエモートを再生し、接続されている場合はサーバーでemotePlayedイベントを発火します。この関数は特定のクライアントのLocalScriptからのみ呼び出すことができます。
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
local shrug = EmoteBar.getEmote("Shrug")
EmoteBar.playEmote(shrug)lockEmote
lockEmote(emoteName: string)
指定された名前のエモートをロックします。この関数はクライアントのLocalScriptからのみ呼び出すことができます。
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.lockEmote("Applaud")unlockEmote
unlockEmote(emoteName: string)
指定された名前のエモートのロックを解除します。この関数はクライアントのLocalScriptからのみ呼び出すことができます。
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.unlockEmote("Applaud")イベント
emotePlayed
任意のクライアントがエモートを再生したときに発火します。このイベントはLocalScript内でのみ接続できます。
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.emotePlayed:Connect(function(player, emote)
print(player.Name, "played", emote.name)
end)lockedEmoteActivated
クライアントがロックされたエモートをクリックしたときに発火します。このイベントはLocalScript内でのみ接続できます。
| パラメータ | |
|---|---|
| emote: エモート | アクティブ化されたロックされたエモート。 |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local EmoteBar = require(ReplicatedStorage.EmoteBar)
EmoteBar.lockedEmoteActivated:Connect(function(emote)
print(Players.LocalPlayer, "clicked", emote.name)
end)