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
 

Re: Starting lines

Previous Thread :: Next Thread 
RockTheMIC is not online. RockTheMIC
Joined: 22 Jul 2011
Total Posts: 2319
03 Nov 2012 04:28 PM
What are the starting lines if I press the key r and hold it down and then if I release and what will be the connection? I will do the effect of it myself.
Report Abuse
Monkey727 is not online. Monkey727
Joined: 12 Jan 2009
Total Posts: 969
03 Nov 2012 04:35 PM
If your pressing keys down, The only thing I could think of is doing it with a Hopperbin:


function onKeyDown(key)
if key == "r" then
-- Pressed r
end
end

function onKeyUp(key)
if key == "r" then
-- Released r
end
end

function onSelected(mouse)
mouse.KeyDown:connect(onKeyDown)
mouse.KeyUp:connect(onKeyUp)
end

script.Parent.Selected:connect(onSelected)

As for the "holding down r" you would need to put a wait between the KeyUp and KeyDown functions or something. Kinda confusing for me to explain so try and figure the rest out by your self. :3
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
03 Nov 2012 04:38 PM
I belive GetMouse would work too, so:

function onKeyDown(key)
if key == "r" then
print("User pressed '"..key.."'!")
end
end
function onKeyUp(key)
if key == "r" then
print("User depressed '"..key.."'!")
end
end
mouse = game.Players.Player:GetMouse()
mouse.KeyDown:connect(onKeyDown)
mouse.KeyUp:connect(onKeyUp)
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