У нас вы можете посмотреть бесплатно ROBLOX: Detect User Input w/ UserInputService or ContextActionService (How to) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Detect User Input (ROBLOX) with UserInputService and ContextActionService. In this tutorial, I will teach you how to detect user input in roblox using UserInputService and ContextActionService. I will also explain this differences between the two services, and why you might want to use one over the other. In this video, we'll be using UserInputService and ContextActionService to detect user input in our game. By doing this, we'll be able to track the input of our players and respond accordingly. This video is designed to be a beginner's guide to UserInputService and ContextActionService. If you're new to these services, then I Highly recommend watching this video before trying to use them in your own projects. Timestamps: 0:00 - Introduction 0:27 - UserInputService 3:35 - ContextActionService 10:10 - Comparing the UserInputService and the ContextActionService 13:01 - Outro Code: UserInputService: local UIS = game:GetService("UserInputService") local count = 0 local function onInputBegin(input, processed) if count (REPLACE WITH LESS THAN SYMBOL) 10 then if input.KeyCode == Enum.KeyCode.X then local part = workspace.Part part.Color = Color3.fromRGB(255, 0, 0) count += 1 elseif input.KeyCode == Enum.KeyCode.Z then local part = workspace.Part part.Color = Color3.fromRGB(0, 255, 0) count += 1 end end end UIS.InputBegan:Connect(onInputBegin) ContextActionService: local CAS = game:GetService("ContextActionService") local count = 0 local function changePartColor(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then local part = workspace.Part if actionName == "changePartColorRed" then part.Color = Color3.fromRGB(255, 0, 0) count += 1 elseif actionName == "changePartColorGreen" then part.Color = Color3.fromRGB(0, 255, 0) count += 1 end end if count == 10 then print("Unbinding Action...") CAS:UnbindAction("changePartColorRed") CAS:UnbindAction("changePartColorGreen") end end CAS:BindAction("changePartColorRed", changePartColor, false, Enum.KeyCode.X) CAS:BindAction("changePartColorGreen", changePartColor, false, Enum.KeyCode.Z)