KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 17 Sep 2016 12:04 PM |
local ReloadIncrement = -0.1
for i = Reload.Value,0,ReloadIncrement do wait(math.abs(ReloadIncrement)) Reload.Value = math.floor((i * 10) + 0.5) / 10 end
Whenever i set the reload time to under 4.5 seconds it reloads until it hits 0.1 and stops(doesnt reload fully). |
|
|
| Report Abuse |
|
|
Monadic
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 731 |
|
|
| 17 Sep 2016 12:08 PM |
"local ReloadIncrement = -0.1" Are you an idiot? |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 17 Sep 2016 12:12 PM |
| Thanks man. I guess i didnt want help after all. |
|
|
| Report Abuse |
|
|
Monadic
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 731 |
|
|
| 17 Sep 2016 12:13 PM |
| It's okay. I can see you're new to this whole thing. |
|
|
| Report Abuse |
|
|
|
| 17 Sep 2016 12:14 PM |
| You don't have a negative increment in a for loop. Just have it positive and use negative i inside the loop. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 17 Sep 2016 12:18 PM |
@Mister local ReloadIncrement = 0.1
for i = Reload.Value,0,ReloadIncrement do wait(ReloadIncrement) Reload.Value = math.floor((-i * 10) + 0.5) / 10 end
I cant tell if this was what you are saying but from here i cant tell it wont do anything at all. Btw it was reloading fine when the total time it takes was above 4.5.
|
|
|
| Report Abuse |
|
|
|
| 17 Sep 2016 12:21 PM |
I wasn't saying anything.
This is just a math problem, you just need to look at it in a way so that it makes sense so you're not just trying random things until it works. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 17 Sep 2016 12:22 PM |
| i can* tell it wont do anything at all. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 17 Sep 2016 12:26 PM |
| ugh whatever. I've said it only doesn't work when I turn the reload time under 4.5 seconds but you arent getting it. |
|
|
| Report Abuse |
|
|
|
| 17 Sep 2016 12:28 PM |
| Like I said, it's a math problem. You need to look at the code and figure out WHY it wont work for values under 4.5 seconds. Derive the solution from that and fix the code accordingly. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 17 Sep 2016 12:32 PM |
| I've been looking at it since I found it(about 2-3 months ago). I'm asking because I have no idea. I'm not looking for moral support. |
|
|
| Report Abuse |
|
|
|
| 17 Sep 2016 12:34 PM |
| I'm not giving you any. If you found the code somewhere else you should probably rewrite it so it makes sense. |
|
|
| Report Abuse |
|
|
|
| 17 Sep 2016 12:35 PM |
| I don't know the context of the code, so it doesn't make sense to me either. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 17 Sep 2016 12:39 PM |
| I wrote it. It's for a tank game, if you want more context you can go to K'nats on my profile. |
|
|
| Report Abuse |
|
|