Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

1 answer

✓ Accepted answer

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!

2 comments

0

thx

0

Np

This discussion is preserved as it was. New answers, comments, and votes are closed.