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

How can I get the UserInputService to grab the key "e"?

Asked by 10 years ago

So I can make it trigger the animation in my gui so that people can press "e" and my gui animation will occur I have no idea how to do this and I need help so please help.

2 answers

Log in to vote
1
Answered by 10 years ago

UserInputService is not required to create a KeyDown function.

I suggest reading the Wiki for help on KeyDown and help on Animations.

Click on the "Playing Animations in Player Character", section 2.1, in the table of contents of the Wiki I linked you for the animations.

How to make a function for the key F from a LocalScript:

local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()

Mouse.KeyDown:connect(function(key))
if key == "f" then
--code
end
end)
0
Well I am mostly trying to make the key down function only 1 specific key. And im not trying to do body animations im trying to do it with gui animations. AWESOMEnoob3 3 — 10y
0
Edited my answer. SlickPwner 534 — 10y
0
thanks!!! AWESOMEnoob3 3 — 10y
0
It worked ty AWESOMEnoob3 3 — 10y
Ad
Log in to vote
-3
Answered by 10 years ago

local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() mouse.KeyDown:connect(function(key) print(key) end)

0
but how do I make it a specific key??? Thats what I really want to know. AWESOMEnoob3 3 — 10y

Answer this question