|
| 15 Jun 2016 07:04 PM |
local match = script.Parent local f = Instance.new("Fire") f.Size = 1 f.Heat = 1 local debounce = false match.Equipped:connect(function(mouse) if debounce == false then debounce = true local target = mouse.Target while true do wait() if mouse.Target == nil then return elseif mouse.Target == workspace.Light then mouse.Button1Down:connect(function() f:Clone().Parent = match.Part end) end end end debounce = false end)
This clones fire too many times. Does someone know why? |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2016 07:12 PM |
I switched the debounce.
local match = script.Parent local f = Instance.new("Fire") f.Size = 1 f.Heat = 1 match.Equipped:connect(function(mouse) local target = mouse.Target while true do wait() if mouse.Target == nil then return elseif mouse.Target == workspace.Light then local debounce = false mouse.Button1Down:connect(function() if debounce == false then debounce = true f:Clone().Parent = match.Part end debounce = false end) end end end) |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2016 07:13 PM |
| It looks like you 'while true do' loop is endlessly firing the function. Maybe add a break after it fires the clone function? |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Jun 2016 07:19 PM |
| oh lol Im just using enabled and disabled duh. |
|
|
| Report Abuse |
|
|
|
| 15 Jun 2016 07:20 PM |
| break will stop a while true do loop as well. |
|
|
| Report Abuse |
|
|
Borsy
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 15111 |
|
|
| 15 Jun 2016 07:59 PM |
break breaks any loop, that is while, repeat, for,
|
|
|
| Report Abuse |
|
|