of     1   

OfficerJorden139
#182921848Wednesday, February 03, 2016 4:54 AM GMT

How do you make a script that detects if you have pressed a key on your keyboard to do something?
super10099
#182922088Wednesday, February 03, 2016 4:59 AM GMT

local inputService = game:GetService("UserInputService") inputService.InputBegan:connect(function(inputObject, gameProcessedEvent) print(inputObject .. " WAS PRESSED") end)
OfficerJorden139
#182922174Wednesday, February 03, 2016 5:01 AM GMT

But how do I make separate keys do something?
super10099
#182922213Wednesday, February 03, 2016 5:02 AM GMT

woopse local inputService = game:GetService("UserInputService") inputService.InputBegan:connect(function(inputObject, gameProcessedEvent) print(inputObject.KeyCode) end)
OfficerJorden139
#182922416Wednesday, February 03, 2016 5:06 AM GMT

I thought there was a easier layout then that that included something like if key == "f" then fly = true end or something like that?
super10099
#182922564Wednesday, February 03, 2016 5:10 AM GMT

local inputService = game:GetService("UserInputService") inputService.InputBegan:connect(function(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.R then print("User have pressed R!") end end)
OfficerJorden139
#182922961Wednesday, February 03, 2016 5:19 AM GMT

Thanks! Also can you help me with my scripting you seem experienced enough.

    of     1