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 » Scripting Helpers
Home Search
 

InputObject script (advanced help)

Previous Thread :: Next Thread 
flams2000 is not online. flams2000
Joined: 29 Apr 2009
Total Posts: 188
07 Apr 2014 07:14 PM
I'm trying to insert a InputObject into game.Workspace so I can view the properties and how I can use it. I've used the wiki but there isn't much help to how I can insert this.

The goal is to be able to read when the player presses 'e' it runs a script by using the InputObject to read the keys being pressed. Any and all other alternatives will be helpful

Wiki article: http://wiki.roblox.com/index.php?title=RBX.lua.InputObject_(Object)

Script:
function p()
i = Instance.new("InputObject")
i.Parent = game.Workspace
end

I don't get any errors from this but "InputObject" isn't inserted
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
07 Apr 2014 07:16 PM
You're doing it wrong

game:GetService'UserInputService'

Input object is just a placeholder.
Report Abuse
flams2000 is not online. flams2000
Joined: 29 Apr 2009
Total Posts: 188
07 Apr 2014 07:18 PM
Will I have to use localscripts to use this?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
07 Apr 2014 07:19 PM
Yes.
Report Abuse
flams2000 is not online. flams2000
Joined: 29 Apr 2009
Total Posts: 188
07 Apr 2014 07:20 PM
could you give an example of reading a key off of the UserInputService?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
07 Apr 2014 07:43 PM
userInput = game:GetService("UserInputService")

userInput.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputState == Enum.UserInputState.Begin and input.KeyCode == Enum.KeyCode.Tab then
print("tab placed")
end
end)
Report Abuse
flams2000 is not online. flams2000
Joined: 29 Apr 2009
Total Posts: 188
07 Apr 2014 07:52 PM
Thank you :)
Report Abuse
Ariophy is not online. Ariophy
Joined: 08 Mar 2014
Total Posts: 81
07 Apr 2014 07:53 PM
am covered in galaxy
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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