ContextActionService

顯示已棄用項目

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡

無法建立
服務

允許體驗將玩家輸入綁定到上下文行動或只有在某些條

概要和行動

上下文 是指在玩家執行某些操動作時的條件。一些範例包括持有 Tool 、坐在汽車上或站在門附近等。無論

行動 是指玩家

處理行動中的動作上下文

您最好使用 <

檢查限定動作

要查看一個清單的動作和其對應輸入,您可以在開發者控制台 (F9 在遊戲中) 中檢視「行動綁定」標籤。這會

鍵盤輸入

這種服務對遊戲手柄和觸摸輸入特別有用。 對於遊戲手柄輸入,您可以選擇將 B 按鈕綁定到返回用戶到另一個菜單時返回上一

範例程式碼

This example properly shows how to use ContextActionService in binding user input to a contextual action. The context is the tool being equipped; the action is reloading some weapon. Test this code sample by placing it in a LocalScript parented to a Tool. When the Tool is equipped, a "Reload" action is bound, and when the Tool is unequipped the "Reload" action is unbound. When the player presses R with the Tool equipped, the message "Reloading!" will appear.

ContextActionService Tool Reload

local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Reload"
local tool = script.Parent
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Reloading!")
end
end
tool.Equipped:Connect(function()
ContextActionService:BindAction(ACTION_RELOAD, handleAction, true, Enum.KeyCode.R)
end)
tool.Unequipped:Connect(function()
ContextActionService:UnbindAction(ACTION_RELOAD)
end)

概要

方法

屬性

方法

BindAction

void

將一個行動綁定給指定的使用者輸入的行動處

下面的代碼示例顯示了如何使用 Sound 來在 played 鍵 ( H ) 、遊戲控制器按鈕或觸摸屏幕按鈕時按下。


local ContextActionService = game:GetService("ContextActionService")
-- 一輛車的喇叭聲
local honkSound = Instance.new("Sound", workspace)
honkSound.Looped = true
honkSound.SoundId = "rbxassetid://9120386436"
local function handleAction(actionName, inputState, inputObject)
if actionName == "HonkHorn" then
if inputState == Enum.UserInputState.Begin then
honkSound:Play()
else
honkSound:Pause()
end
end
end
-- 玩家坐在車輛上時:
ContextActionService:BindAction("HonkHorn", handleAction, true, Enum.KeyCode.H, Enum.KeyCode.ButtonY)
-- 玩家退出時:
ContextActionService:UnbindAction("HonkHorn")

行動處理器參數

動作處理器會以下參數來啟動:


<tr>
<td>1</td>
<td><code>字串</code></td>
<td>與原始傳入 BindAction 的相同串</td>
</tr>
<tr>
<td>2</td>
<td><code>枚列使用者輸入狀態</code></td>
<td>輸入狀態 (開始、變更、結束或取消)\*</td>
</tr>
<tr>
<td>3</td>
<td><code>輸入對象</code></td>
<td>一個包含輸入資訊的對象(視乎使用者輸入類型而異)</td>
</tr>
#類型說明

※這允許一個功能處理多個操作,如有需要。*取消是發生在有輸入進行中,或是在有輸入和其他操作綁定在進行中,或是有進度操作綁定在進行中,或是有進度操作綁定在進行中,或是有進度操作綁定在進行中,或是有進度操作綁定在進行中,或是有進度操作綁定在進行中,或是有進度操作綁定在進行中,或是有進度操

動作綁定堆疊

觸摸按鈕

除了輸入類型外,此功能的第三個參數控制按鈕是否為 Class.UserInputService.TouchEnabled|TouchEnabled

參數

actionName: string

代表要執行的動作的字串(例如「HonkHorn」或「OpenDoor」)。

functionToBind: function

當綁定輸入啟動時,會呼叫以下參數:string (actionName)、Enum.UserInputState 和輸入對象。

createTouchButton: bool

是否需要為觸摸輸入設備創建按鈕。

inputTypes: Tuple

任何數字的 Enum.KeyCodeEnum.UserInputType 代表輸入以綁定操動作。


返回

void

範例程式碼

This example properly shows how to use ContextActionService in binding user input to a contextual action. The context is the tool being equipped; the action is reloading some weapon. Test this code sample by placing it in a LocalScript parented to a Tool. When the Tool is equipped, a "Reload" action is bound, and when the Tool is unequipped the "Reload" action is unbound. When the player presses R with the Tool equipped, the message "Reloading!" will appear.

ContextActionService Tool Reload

local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Reload"
local tool = script.Parent
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Reloading!")
end
end
tool.Equipped:Connect(function()
ContextActionService:BindAction(ACTION_RELOAD, handleAction, true, Enum.KeyCode.R)
end)
tool.Unequipped:Connect(function()
ContextActionService:UnbindAction(ACTION_RELOAD)
end)

This code sample uses ContextActionService to bind an action named "BoundAction" to a general action handler function on the F key. Place this in a LocalScript inside StarterPlayerScripts and press F to see the message "Handling action: BoundAction".

General Action Handler

local ContextActionService = game:GetService("ContextActionService")
local function handleAction(actionName, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
print("Handling action: " .. actionName)
print(inputObj.UserInputType)
end
-- Since this function does not return anything, this handler will
-- "sink" the input and no other action handlers will be called after
-- this one.
end
ContextActionService:BindAction("BoundAction", handleAction, false, Enum.KeyCode.F)

This code sample demonstrates how BindAction acts like a stack. It binds two actions, FirstAction (Z, X, and C keys) and SecondAction (Z and X keys) to two action handling functions. The second one will pass on a certain input (the X key).

Both actions use the Z and X keys, however the second handler will pass input only if X is pressed. So, when X is pressed, the second handler is called and then the first. The first action is also bound to the C key, and can be triggered even though the other two inputs are "covered" by the second action.

Test this code out by pasting it into a LocalScript within StarterPlayerScripts, then pressing Z, X and C. Observe which action handlers are called with what actions.

Stacked Action Handlers

local ContextActionService = game:GetService("ContextActionService")
-- Define an action handler for FirstAction
local function actionHandlerOne(actionName, inputState, _inputObj)
if inputState == Enum.UserInputState.Begin then
print("Action Handler One: " .. actionName)
end
-- This action handler returns nil, so it is assumed that
-- it properly handles the action.
end
-- Binding the action FirstAction (it's on the bottom of the stack)
ContextActionService:BindAction("FirstAction", actionHandlerOne, false, Enum.KeyCode.Z, Enum.KeyCode.X, Enum.KeyCode.C)
-- Define an action handler for SecondAction
local function actionHandlerTwo(actionName, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
print("Action Handler Two: " .. actionName)
end
if inputObj.KeyCode == Enum.KeyCode.X then
return Enum.ContextActionResult.Pass
else
-- Returning nil implicitly Sinks inputs
return Enum.ContextActionResult.Sink
end
end
-- Binding SecondAction over the first action (since it bound more recently, it is on the top of the stack)
-- Note that SecondAction uses the same keys as
ContextActionService:BindAction("SecondAction", actionHandlerTwo, false, Enum.KeyCode.Z, Enum.KeyCode.X)

BindActionAtPriority

void

BindActionAtPriority 與 BindAction 相似,但也允許指定優先權。如果多個操作綁定到同一個輸入,則優先權高度函數無視不同操作的訂單。在其他 words,這個函數會重新定義 BindAction 的預期行為。

參數

actionName: string

代表要執行的動作的字串(例如「HonkHorn」或「OpenDoor」)。

functionToBind: function

當綁定輸入啟動時,會呼叫以下參數:string (actionName)、Enum.UserInputState 和輸入對象。

createTouchButton: bool

是否需要為觸摸輸入設備創建按鈕。

priorityLevel: number

行動應該綁定的優先級等級(最高值在下方)。

inputTypes: Tuple

任何數字的 Enum.KeyCode 或 Enum.UserInputType 代表輸入以綁定到操動作。


返回

void

範例程式碼

This code sample demonstrates how ContextActionService:BindActionAtPriority() can be used to bind actions out of order yet still have the same priority levels. Normally, BindAction() would operate on order (last bound action has highest priority), but priority levels override this. You can test this code by pasting it into a Script with RunContext = Client in ReplicatedStorage.

ContextActionService BindAction Priorities

local ContextActionService = game:GetService("ContextActionService")
local INPUT_KEY1 = Enum.KeyCode.Q
local INPUT_KEY2 = Enum.KeyCode.E
local function handleThrow(actionName: string, inputState: Enum.UserInputState, inputObject: InputObject)
if inputState ~= Enum.UserInputState.Begin then
return Enum.ContextActionResult.Pass
end
print(`Action [{actionName}] occurred. KeyCode [{inputObject.KeyCode}] pressed.`)
return Enum.ContextActionResult.Sink
end
local function handlePunch(actionName: string, inputState: Enum.UserInputState, inputObject: InputObject)
if inputState ~= Enum.UserInputState.Begin then
return Enum.ContextActionResult.Pass
end
print(`Action [{actionName}] occurred. KeyCode [{inputObject.KeyCode}] pressed.`)
return Enum.ContextActionResult.Sink
end
-- Without specifying priority, the most recently bound action is called first,
-- so pressing INPUT_KEY1 prints "Punch" and then sinks the input.
ContextActionService:BindAction("DefaultThrow", handleThrow, false, INPUT_KEY1)
ContextActionService:BindAction("DefaultPunch", handlePunch, false, INPUT_KEY1)
-- Here we bind both functions in the same order as above, but with explicitly swapped priorities.
-- That is, we give "Throw" a higher priority of 2 so it will be called first,
-- despite "Punch" still being bound more recently.
-- Pressing INPUT_KEY2 prints "Throw" and then sinks the input.
ContextActionService:BindActionAtPriority("PriorityThrow", handleThrow, false, 2, INPUT_KEY2)
ContextActionService:BindActionAtPriority("PriorityPunch", handlePunch, false, 1, INPUT_KEY2)

BindActivate

void

Enum.KeyCode 綁定到 Enum.UserInputType 使用 ClickDetector 事件,2> Class.Tool|Tools2> 和 5> Class.GuiButton|GuiButtons

注意,Enum.UserInputType 指定必須為 KeyboardGamepad1 通過 1>Gamepad81> 以獲得有效。

參數

userInputTypeForActivation: Enum.UserInputType

必須是鍵盤或 Gamepad1 通過 Gamepad8。

keyCodesForActivation: Tuple

返回

void

GetAllBoundActionInfo

GetAllBindActioninfo 返回一個表,其中將所有行動的名稱 (原來傳送至 Class.ContextActionService:BindAction()|BindAction) 映射到表 (使用此函數時,您可以檢查所有正在綁定的行動) 返回 Class.ContextActionService:GetBindActionInfo()|GetBindAction 時。使用此功能,您可以檢查所有現


返回

GetBoundActionInfo

GetBoundActionInfo 返回一個包含以下鍵描述鍵定義的動作的表。要獲得所有動作的相同資訊,請使用 GetAllBoundActionInfo


<tr>
<td><code>stackOrder</code></td>
<td>數字</td>
<td>
描述堆叠中的行動索引(增加)
</td>
</tr>
<tr>
<td><code>優先級等級</code> \*</td>
<td>數字</td>
<td>
描述<code>Class.ContextActionService:BindActionAtPriority()|priority</code>級的動作動
</td>
</tr>
<tr>
<td><code>建立按鈕</code></td>
<td>boolean</td>
<td>
描述是否在 <code>Class.UserInputService.TouchEnabled|TouchEnabled</code> 裝置上需要創建觸摸按鈕
</td>
</tr>
<tr>
<td><code>輸入類型</code></td>
<td>表</td>
<td>
輸入類型傳送至 <code>Class.ContextActionService:BindAction()|BindAction</code> 以啟動此操作
</td>
</tr>
<tr>
<td><code>說明</code> †</td>
<td>字串</td>
<td>
Class.ContextActionService:SetDescription()|SetDescription的描述
</td>
</tr>
<tr>
<td><code>標題</code> ※</td>
<td>字串</td>
<td>
由 <code>Class.ContextActionService:SetTitle()|SetTitle</code> 設定的行動集合的標題
</td>
</tr>
<tr>
<td><code>圖像</code> ※</td>
<td>字串</td>
<td>
Class.ContextActionService:SetImage()|SetImage 設定的動作按鈕圖像
</td>
</tr>
名稱類型說明

※優先級等級仍會包含,即使 BindActionAtPriority 未使用 - 預設為 2000。

※ 指示此欄位將會是 nil 如果沒有呼叫指定的動作法。

參數

actionName: string

返回

GetCurrentLocalToolIcon

GetCurrentLocalToolIcon 將返回 BackpackItem.TextureId 的 Class.Tool 目前 Toolequipped 或 1> nil1> 如果沒有此工具或玩家沒有足夠的工具即可 從


返回

來自工具的 TextureId 的內容字串,或零,如果沒有找到。

SetDescription

void

將描述設定將螢幕描述的描述BindAction 。在可用的動作列表中,這是描述提供的動作的文字。

雖然名稱可能暗示此方法與相關的功能家族有關(SetTitleSetImageSetPosition),此方法對此按鈕不起作用。此方法只是設置一個

參數

actionName: string

原來此操作的名稱為「BindAction」。

description: string

一個文字描述操動作的詳細說明,例如「響車的喇叭」或「打開道具欄」。


返回

void

範例程式碼

This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.

Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.

ContextActionService Touch Button

local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end

SetImage

void

此方法設定 BindAction() 的圖像,創建於 ImageLabel.Image 內的 ImageLabel 屬性。它的具體設置如下 2>Class.ImageLabel.Image2> 內

此功能是自訂動作按鈕的觸摸按鈕的一個家族的方法。其他方法在此家族中包括 SetPositionSetTitle

參數

actionName: string

原來此操作的名稱為「BindAction」。

image: string

影像屬性應設定的值。


返回

void

範例程式碼

This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.

Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.

ContextActionService Touch Button

local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end

SetPosition

void

此方法設置 BindAction() 的位置,由 GuiObject.Position 創建。 它的具體位置是 ImageButton 的 2>Class.Button2> 將被返回 5>Class.ContextActionService:GetButton()

此功能是自訂動作按鈕的家族的方法的一部分。其他方法包括 SetImageSetTitle

參數

actionName: string

原來此操作的名稱為「BindAction」。

position: UDim2

在 ContextButtonFrame 中的位置。


返回

void

範例程式碼

This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.

Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.

ContextActionService Touch Button

local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end

SetTitle

void

設定稱號會設定顯示在 BindAction 內的文字。Specifically, this 設定在 TextLabel.Text 內的 TextLabel 屬性。2>Class.TextLabel.Text

此功能是自訂動作按鈕的觸摸按鈕的一個家族的方法。其他方法在此家族中包括 SetImageSetPosition

參數

actionName: string

原來此操作的名稱為「BindAction」。

title: string

按鈕上顯示的文字。


返回

void

範例程式碼

This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.

Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.

ContextActionService Touch Button

local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end

UnbindAction

void

UnbindAction 會從使用者輸入中的名稱解除一個行動的綁定,因此行動處理器功能將不再呼叫。當某個行動的上下文不再適用時,例如關閉用戶界面、退出車輛或 unequipping 一個 Tool 。 請

此功能 不會 發生錯誤,如果沒有此鍵與指定的字串相關。使用 GetAllBoundActionInfo 或開發者控制台的「綁定動作」標籤,您可以查看目前綁定的動作。

參數

actionName: string

返回

void

範例程式碼

This example properly shows how to use ContextActionService in binding user input to a contextual action. The context is the tool being equipped; the action is reloading some weapon. Test this code sample by placing it in a LocalScript parented to a Tool. When the Tool is equipped, a "Reload" action is bound, and when the Tool is unequipped the "Reload" action is unbound. When the player presses R with the Tool equipped, the message "Reloading!" will appear.

ContextActionService Tool Reload

local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Reload"
local tool = script.Parent
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Reloading!")
end
end
tool.Equipped:Connect(function()
ContextActionService:BindAction(ACTION_RELOAD, handleAction, true, Enum.KeyCode.R)
end)
tool.Unequipped:Connect(function()
ContextActionService:UnbindAction(ACTION_RELOAD)
end)

UnbindActivate

void

解除雙綁Activate 使用 Enum.KeyCode (或 Enum.UserInputType ) 以啟動 Tool (或 1> Class.HopperBin1> ) 的任何操作。此功能通常會解除該功能所執行的操作。

參數

userInputTypeForActivation: Enum.UserInputType

同一個 UserInputType 最初傳送至 BindActivate。

keyCodeForActivation: Enum.KeyCode

原本的 KeyCode 已傳送至 BindActivate。

預設值:"Unknown"

返回

void

UnbindAllActions

void

移除所有綁定的功能。所有 actionNames 將不會剩餘。所有觸摸按鈕將被移除。如果按鈕被手動操作,就沒有保證它會被清理。


返回

void

GetButton

暫停

GetButton 返回由 ImageButton 創建的, BindAction 如果其第三個參數是真的,並且設備是 TouchEnabled 。 此函數的唯一參數必須與原來發送到 BindAction 的動作名稱完全一致。

如果沒有此動作的指定或按鈕沒有創建,此函數將返回 nil

參數

actionName: string

原來此操作的名稱為「BindAction」。


返回

一個由 BindAction 創建的圖像按鈕。

活動

LocalToolEquipped

發射當前玩家裝備 Tool 時。

參數

toolEquipped: Instance

LocalToolUnequipped

發生當前玩家卸下 Tool 時。

參數

toolUnequipped: Instance