Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 09 Oct 2015 05:34 PM |
what would would i insert into a "wait" if i wanted an inital value to reach a final value what the intial and final value is
like it would take 7 seconds for the initial value to reach the maximum value regardless of what the maximum value is
example 1: inital value = 0 max value = 50 0 goes to 50 in a 7 second span example 2: intial value = 0 max value = 200 0 goes to 200 in a 7 second span example 3: initial value = 10 max value = 70 10 goes to 70 in a 6 second span(since the inital value is already at 10)
p.s. this was already asked but it was too vague |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2015 05:38 PM |
repeat wait(0.5) script.IntValue.Value = script.IntValue.Value + 1 until script.IntValue.Value == 10
Put an intvalue in a script and make the value 0 |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 09 Oct 2015 05:42 PM |
but that doesn't have a max val.. look:
for i = 1, maxValue-initalValue do initalValue.Value = initalValue.Value+1 wait(7/i) -- i tried this but doesnt work end |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 09 Oct 2015 05:44 PM |
http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting
-=Robo=- |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
| |
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
| |
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
| |
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
| |
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
| |
|
|
| 09 Oct 2015 06:32 PM |
repeat wait(0.5) script.IntValue.Value = script.IntValue.Value + 1 until script.IntValue.Value == script.MaxValue.Value
The noobs shall be eradicated. |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 09 Oct 2015 06:38 PM |
| thats not what im asking, what needs to be modified is what's within the wait() |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
| |
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 09 Oct 2015 06:56 PM |
http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting [2]
-=Robo=- |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2015 07:00 PM |
for i = 1,70,1 do maxvalue = i wait() end
i'm not your math teacher so i won't bother calculating the wait for it. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2015 07:02 PM |
Stop bumping and go back to math class.
If you want 7 seconds to elapse with an event firing multiple times in said time, you'd obviously divide the amount of time by the amount of iterations to get the delta time to wait between iterations. |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
| |
|
|
| 09 Oct 2015 07:13 PM |
| What's rude is bumping 80 times when you're already on the front page for such a trivial question. |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 09 Oct 2015 07:16 PM |
its trivial for u
i keep bumping until i get an answer i understand
bump |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 09 Oct 2015 07:25 PM |
^idiots don't understand try google or perhaps http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting
-=Robo=- |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2015 07:28 PM |
If you want something to happen 10 times in seven seconds 7/10 = .7 The wait time would be .7 seconds
If you want something to change from 0 - 50 over 10 iterations 50/10 = 5 Add 5 to each iteration
Some people shouldn't be allowed on the internet without taking an IQ test. You're one of those people. |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 09 Oct 2015 07:33 PM |
| not what im asking.. i said it has take 7 seconds to get from any given intial value to any maximum value i posted the line earlier |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2015 07:37 PM |
That's exactly what I just explained. .-. num = 0 for i = 1,10 do wait(.7) -- .7*10 = 7 seconds num = num+5 -- 5*10 = 50 end
'example 1: inital value = 0 max value = 50 0 goes to 50 in a 7 second span'
>7 seconds elapse and num changes from 0 to 50 |
|
|
| Report Abuse |
|
|
qoazi
|
  |
| Joined: 16 Oct 2008 |
| Total Posts: 2 |
|
|
| 09 Oct 2015 07:57 PM |
From any value, To any value in 7 seconds. Always 7 seconds right?
for i = initalValue, maxValue do initalValue.Value = initalValue.Value+1 wait(7/(maxValue - initialValue)) end
This should Count From the initialValue, up to the Maxvalue, Waiting a 7th of the amount of iterations each time, Since it's a 7th of the amount of iterations, And it Always iterates all the way, That will Always add up to a total 7 second wait |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 09 Oct 2015 08:23 PM |
| well not from ANY initial value to ANY max value.. i know 0 to 50 will take 7 seconds but let's say it was 40 to 50, it doesn't take 7 seconds, it takes a smaller amount of time since 40(the initial value) is already at 40.. if that makes sense |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2015 08:30 PM |
Take the delta, start from minvalue iterations = ??? - set between 1- ~210 delta = (max-min)/iterations num = min for i = 1,iterations do wait(7/iterations) num = num+delta end
|
|
|
| Report Abuse |
|
|