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: Repeat Something On Key Down Until Key Up

Previous Thread :: Next Thread 
drgn42 is not online. drgn42
Joined: 11 Feb 2010
Total Posts: 3231
27 Jan 2015 09:04 AM
How do I add 1 to an int value until they unpress the key? Let's just assume they're pressing f.
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
27 Jan 2015 09:29 AM
local key = 's'
local m = plr:GetMouse()
val = 0
m.KeyDown:connect(function(k) local x = k:lower()
if x == key then down = true
m.KeyUp:connect(function(z) local p = z:lower()
if p == key then
down = false
end
end)
repeat wait() val = val + 1 until down = false
end
end)
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
27 Jan 2015 09:58 AM
codepad
/DPqOj8Ad
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