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
 

Re: Efficient UIS

Previous Thread :: Next Thread 
Fribet is not online. Fribet
Joined: 08 Feb 2014
Total Posts: 700
06 Sep 2015 01:01 PM
Heres what I have:

service = game:GetService("UserInputService")

service.InputBegan:connect(function(p)
print(tostring(p.KeyCode):sub(14)) --Start at the 14th letter thing
end)

Instead of having to find the input cant you use something to automatically return the input?
Report Abuse
Fribet is not online. Fribet
Joined: 08 Feb 2014
Total Posts: 700
06 Sep 2015 01:08 PM
halp
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
06 Sep 2015 01:12 PM
lol
Report Abuse
Fribet is not online. Fribet
Joined: 08 Feb 2014
Total Posts: 700
06 Sep 2015 01:16 PM
plzzzzz
Report Abuse
Fribet is not online. Fribet
Joined: 08 Feb 2014
Total Posts: 700
06 Sep 2015 01:31 PM
e.e
Report Abuse
Fribet is not online. Fribet
Joined: 08 Feb 2014
Total Posts: 700
06 Sep 2015 01:38 PM
"lol" was the most helpful advice D;
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
06 Sep 2015 01:39 PM
print(p.KeyCode.Name)
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
06 Sep 2015 01:43 PM
"Instead of having to find the input cant you use something to automatically return the input?"

local UIS = game:GetService("UserInputService")

local function listenForInput()
local input, gpe = UIS.InputBegan:wait()
print(input, gpe)
return input, gpe
end

local newInput, gameProcessedEvent = listenForInput()

what is the point though?

Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
06 Sep 2015 01:47 PM
if it helps, you could get the time elapsed from when you began to listen for input, and when InputBegan fired:

local UIS = game:GetService("UserInputService")

local function listenForInput()
local beginElapsedTimer = tick()
local input, gpe = UIS.InputBegan:wait()
local elaspedTime = (beginElapsedTimer - tick())

print(input, gpe, elapsedTime)
return input, gpe, elapsedTime
end

local newInput, gameProcessedEvent, elapsedTime = listenForInput()
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