devRaver
|
  |
| Joined: 08 Apr 2013 |
| Total Posts: 531 |
|
|
| 08 Apr 2014 12:18 PM |
Is it possible, if so could you tell me how? I want to remove a connection line momentarily, then "reconnect" it. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 08 Apr 2014 12:19 PM |
local connection; connection = script.Parent.Touched:connect(function(hit) --Code end)
connection:disconnect() wait(2)
connection = script.Parent.Touched:connect(function(hit) end) |
|
|
| Report Abuse |
|
|
devRaver
|
  |
| Joined: 08 Apr 2013 |
| Total Posts: 531 |
|
|
| 08 Apr 2014 12:22 PM |
I recall reading a page on the wiki, I think stating; that you're no longer able to use :disconnect(). I could be wrong. :/ |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
| |
|
devRaver
|
  |
| Joined: 08 Apr 2013 |
| Total Posts: 531 |
|
|
| 08 Apr 2014 12:25 PM |
local function error() if l.Value < 500 then connection = script.Parent.MouseButton1Click:connect(click) d = false function click() if d == false then d = true if s.Value > 1 then s.Value = s.Value - 1 end end d = false end end) connection:disconnect() wait(2) connection = script.Parent.MouseButton1Click:connect(click) end)
script.Parent.MouseButton1Click:connect(error)
Would this work? |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 08 Apr 2014 12:31 PM |
I think what you want is debounce.
local function error() if l.Value < 500 then d = false function click() if d == false then d = true if s.Value > 1 then s.Value = s.Value - 1 end end end end wait(2) d = false end
script.Parent.MouseButton1Click:connect(error)
|
|
|
| Report Abuse |
|
|
devRaver
|
  |
| Joined: 08 Apr 2013 |
| Total Posts: 531 |
|
|
| 08 Apr 2014 01:07 PM |
| Do you want me to post the whole script? |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 08 Apr 2014 01:08 PM |
No and I realized an error in mine
local function error() if l.Value < 500 then d = false if d == false then d = true if s.Value > 1 then s.Value = s.Value - 1 end end end wait(2) d = false end
--Connection line here |
|
|
| Report Abuse |
|
|