Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

i dont get what UserInputService, does anyone know what it is?

Asked by 5 years ago

Does anyone know what UserInputService is, I looked it up on wiki but i dont get it.

0
It's the same thing as :GetMouse() seith14 206 — 5y
0
No it’s not Dog2puppy 168 — 5y
0
It's basically the same thing.. It uses all of the stuff :GetMouse() does.. It prints a key or mouseclck, Learn about it here: https://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan seith14 206 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

UserInputService, a service commonly used when we need some key binds going on in our game.

UserInputService is a service that can CURRENTLY only be used in / on the Client. (Roblox states that they will make it work on server)

For now though, you would need a LocalScript in order to get UserInputService. You would do:

local VarName = game:GetService('UserInputService')

Now what does it do? It's pretty self explanatory in the name itself. User input service. This service is used for key binds checking Input from the User.

So how do we detect Input?

local a = game:GetService('UserInputService')

a.InputBegan:Connect(function(input, gamestuff)
    if gamestuff then return end -- cecks if player is doing something on a GUI such as chatting
    print('INPUT!')
end)    

The most common usage I should say is probably key binds itself. Dashing, Double Jump, Movement, Opening Gui's and so on.

For more information check: https://wiki.roblox.com/index.php?title=API:Class/UserInputService

Hopefully this gave you a brief image on what UserInputService is used for.

Best of luck developer!

0
thx User#23365 30 — 5y
0
Np BlackOrange3343 2676 — 5y
Ad

Answer this question