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
 

On Click Function that doesn't allow multiple clicks.

Previous Thread :: Next Thread 
enyahs7 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
27 Aug 2013 11:26 PM
Im trying to figure out how to make sure the OnClicked() function event using Click Detector in models not allowed to be clicked multiple times. So that the same script doesn't run multiple functions. Its annoying because its a weird thing I cant seem to figure out I tried adding values to determine if its multiple clicks or not.
Report Abuse
Gogeta is not online. Gogeta
Joined: 25 Nov 2006
Total Posts: 583
27 Aug 2013 11:30 PM
function OnClicked()
if script.Parent.Value = 0 then
script.Parent.Value = 1

elseif script.Parent.Value = 1 then
end

You tried something like this?
Report Abuse
enyahs7 is not online. enyahs7
Joined: 25 Apr 2008
Total Posts: 9820
27 Aug 2013 11:33 PM
Yeah the numbers like
clicked = 0

function OnClicked()
if clicked == 0 then
clicked = clicked + 1

elseif clicked >= 1 then
clicked = 0
end
Report Abuse
Foxconn is not online. Foxconn
Joined: 20 Feb 2011
Total Posts: 275
27 Aug 2013 11:38 PM
local button = script.Parent
clicks = 0
button.ClickDetector.MouseClick:connect(function()

if clicks == 0 then
clicks = 1
...


end
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