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: How do I change the value on click?

Previous Thread :: Next Thread 
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
06 Aug 2015 01:11 PM
So...

function onClick()
value = value - 1
end

script.Parent.ClickDetector.MouseClick:connect(onClick)


This is using a number value. Value is set to 3, and on click value stays at 3.
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
06 Aug 2015 01:14 PM
numbervalue = workspace.numbervalue

script.Parent.ClickDetector.MouseClick:connect(function()
numbervalue.Value = numbervalue.Value - 1
end)
Report Abuse
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
06 Aug 2015 01:16 PM
Just realized, I forgot to mention that the value shortcut. :[

value = script.Parent.Value.Value

function onClick()
value = value - 1
end

script.Parent.ClickDetector.MouseClick:connect(onClick)


That is the full script.
Report Abuse
GeorgeTolsmaIII is not online. GeorgeTolsmaIII
Joined: 10 Feb 2011
Total Posts: 700
06 Aug 2015 01:25 PM
Volleyball.
Report Abuse
Funse is not online. Funse
Joined: 11 Jun 2012
Total Posts: 7887
06 Aug 2015 01:27 PM
numbervalue = script.Parent.Value

script.Parent.ClickDetector.MouseClick:connect(function()
numbervalue.Value = numbervalue.Value - 1
end)

...
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