ContextActionService
Artık kullanılmayanları göster
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
Kod Örnekleri
ContextActionService Araç Yenile
local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Yenile"
local tool = script.Parent
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Yenileniyor!")
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)
Özet
Özellikler
Yöntemler
- BindAction(actionName : string,functionToBind : function,createTouchButton : boolean,inputTypes : Tuple):()
- UnbindActivate(userInputTypeForActivation : Enum.UserInputType,keyCodeForActivation : Enum.KeyCode):()