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

How can I make the User UserInputService grab the "e" button? Any tutorials?

Asked by 9 years ago

Well. Im trying to make a button trigger a gui animation. So I need to know this.

1 answer

Log in to vote
1
Answered by
OniiCh_n 410 Moderation Voter
9 years ago

This would actually fall into using the Mouse and PlayerMouse properties instead of UserInputService.

Here is some sample code that prints the key pressed to the output: (note: it must be placed inside a LocalScript, which in turn is placed inside of the StarterGui)

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

mouse.KeyDown:connect(function(key)
    print(key)
end)

--Written off the top of my head, may or may not work.
1
thanks ill try this but wait where do I put the key I want people to have to press? AWESOMEnoob3 3 — 9y
Ad

Answer this question