generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

UserImputService?

Previous Thread :: Next Thread 
Garfanzo is online. Garfanzo
Joined: 24 Apr 2015
Total Posts: 742
18 Jan 2016 05:14 PM
I have looked into UserImputService, but I cannot figure out how to use it... Could I get a basic script of how to use it?
Report Abuse
Ryuzoji is not online. Ryuzoji
Joined: 21 Dec 2015
Total Posts: 937
18 Jan 2016 05:18 PM
UserInputService*
Report Abuse
Garfanzo is online. Garfanzo
Joined: 24 Apr 2015
Total Posts: 742
18 Jan 2016 05:18 PM
Thanks man, I have all I need now.
Report Abuse
GliconCraft is not online. GliconCraft
Joined: 17 Dec 2015
Total Posts: 99
18 Jan 2016 05:23 PM
I looked into it in the wiki, and so far I have this, but I haven't figured out how to get keys pressed from it yet, but I'll keep testing and let you know if I come up with anything.


local userinput = game:GetService("UserInputService")

userinput.InputBegan:connect(function(x,x2)
print(x,x2)
end)
Report Abuse
GliconCraft is not online. GliconCraft
Joined: 17 Dec 2015
Total Posts: 99
18 Jan 2016 05:31 PM
Alright, I played around a little more, but I had inconsistent results with what I was trying to accomplish. You can play around with it if you'd like though, I need to get back to what I was originally working on. Thanks for helping me earlier, hoped I could be of any help to you. This is inside of a regular script inside of Workspace:




local userinput = game:GetService("UserInputService")


if userinput.KeyboardEnabled == false then
return
else
print("Keyboard is enabled.")
end

userinput.InputChanged:connect(function(x,x2)
print(x,x2)
if userinput:IsKeyDown(101) then
print("E was pressed!")
end
end)


Report Abuse
UnstableScript0 is not online. UnstableScript0
Joined: 21 Dec 2015
Total Posts: 1189
18 Jan 2016 06:00 PM
game:service'UserInputService'.InputBegan:connect(function(input,gpe)
if gpe or input.UserInputType~=Enum.UserInputType.Keyboard then return end
if input.KeyCode==Enum.KeyCode.E then
print'e was pressed'
end
end)
Report Abuse
Garfanzo is online. Garfanzo
Joined: 24 Apr 2015
Total Posts: 742
18 Jan 2016 06:59 PM
Thanks guys!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image