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

Clicking a key to do something?

Asked by
FizTech 15
8 years ago

So I want my character to run when I click a key on the keyboard. For example when I click shift my speed will increase. I tried to use the KeyDown function but it doesn't really work. Is there another way to do this?

2
Have you tried UserInputService? http://wiki.roblox.com/?title=API:Class/UserInputService ISellCows 2 — 8y
0
No but I will. Thanks FizTech 15 — 8y

1 answer

Log in to vote
0
Answered by
P100D 590 Moderation Voter
8 years ago

The main reason for input scripts not working is that they're local. User input can only be taken from LocalScripts.

However, KeyDown is deprecated. UserInputService is the current way to get user input. http://wiki.roblox.com/?title=API:Class/UserInputService

Ad

Answer this question