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