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: hold down problem

Previous Thread :: Next Thread 
hexon7575 is not online. hexon7575
Joined: 09 Oct 2010
Total Posts: 210
05 Sep 2016 11:55 AM
I need a script that adds 1 to a number value until it reaches 10 while the left mouse button is held down. If the left mouse button is un-clicked, it resets and stops counting until its held down again. How would I do this? I've been trying for literal hours.
Report Abuse
TomsGames is not online. TomsGames
Joined: 11 Oct 2013
Total Posts: 1615
05 Sep 2016 12:01 PM
What is the user clicking? A brick? A gui? Different methods for different circumstances
Report Abuse
xDarkScripter is not online. xDarkScripter
Joined: 31 Jul 2015
Total Posts: 149
05 Sep 2016 12:14 PM
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

local MouseHolding = false
local IncrementSpeed = 0.5
local numValue = 0

Mouse.Button1Down:connect(function()
MouseHolding = true
end)
Mouse.Button1Up:connect(function()
MouseHolding = false
numValue = 0
end)

while IncrementSpeed do
if MouseHolding then
if numValue < 10 then
numValue = numValue + 1
end
end
end
Report Abuse
GraphicsSettings is not online. GraphicsSettings
Joined: 12 Sep 2013
Total Posts: 2883
05 Sep 2016 12:16 PM
:GetMouse() Is deprecated.

I don't advise you use that.
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