|
| 08 Aug 2016 01:23 AM |
tool.Equipped:connect(function(mouse)--put this in to state I have stuff before it end)
while canfire == true and fun > 0 and nofun > 0 do --this isnt working... wait(0.01) if fun > 0 then fun = fun - 0.001 end if nofun > 0 then nofun = nofun - 0.001 end print('Changed '..nofun..', '..fun) end |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 08 Aug 2016 01:26 AM |
By 'not working,' what do you mean? What is it doing, and what do you want it to do?
Off the top of my head, I can say that your two if statements are redundant (the fact the loop is still running means that fun > 0 and nofun > 0). Did you, perhaps, mean something like this?
while true do wait(0.01) if canfire == true then if fun > 0 then fun = fun - 0.001 end if nofun > 0 then nofun = nofun - 0.001 end print('Changed '..nofun..', '..fun) end end |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 01:26 AM |
| No its not running at all. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
| |
|
| |
|
|
| 08 Aug 2016 01:30 AM |
| print(fun,nofun) in each loop and before the loop. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 08 Aug 2016 01:32 AM |
Is the script running at all?
Add a simple, unconditional print to the top of the script. Is it being printed? |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 01:34 AM |
| Trust me everything else works, and it's too long to post here. Only the while loop doesn't work at all. |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 01:34 AM |
| like I said before, print it before and check all your values all the time to see what is wrong |
|
|
| Report Abuse |
|
|