Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 07 Aug 2012 11:19 PM |
debounce = false
function onTouched(Hit) if debounce == false then for i = 10, 100, 10 do debounce = true wait(0.15) script.Parent.Transparency = script.Parent.Transparency +0.1 end script.Parent.CanCollide = false wait (5) for i = 10, 100, 10 do wait(0.15) script.Parent.Transparency = script.Parent.Transparency -0.1 end script.Parent.CanCollide = true debounce = false end end script.Parent.Touched:connect(onTouched)
I'm proud of myself ;'D
Is this hard for you? |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 11:22 PM |
well you're being a little bit excessive with the numeric for loops. you could just go for i = 1, 10 do
and this is pretty basic for me. it creates a neat effect though. nice job. |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 07 Aug 2012 11:24 PM |
Instead of this line: script.Parent.Transparency = script.Parent.Transparency +0.1 Try: script.Parent.Transparency = i/100 ;3 |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 07 Aug 2012 11:26 PM |
@doom
I thoguht 10, 100, 10 and 1, 10, 1 was the same. Thanks :D
@mama
MAMA?!?!? O___o? OHAI :D! |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 11:27 PM |
it is the same.
also if you don't provide a third parameter for the numeric for loop then it is automatically set to 1. |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 07 Aug 2012 11:29 PM |
Hey :3 They basically are, the only difference is the numbers. I would personally do it like so: for i=0, 1, 0.1 do script.Parent.Transparency = i wait(.15) end for i=1, 0, -0.1 do script.Parent.Transparency = i wait(.15) end |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 07 Aug 2012 11:29 PM |
@doom
So, '10, 100, 10 do' will make something 10 times, meanwhile '10, 100 do' Will make something 90 times? =D! |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
| |
|
| |
|
| |
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 07 Aug 2012 11:34 PM |
??? No it would do it 100 o.O for i=1, 100 --from 1, counting by 1, to 100 print(i) wait() end Would print 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 DEDICATION, SON! |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 11:37 PM |
that would be for i = 1, 100 do
he said for i = 10, 100 |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 07 Aug 2012 11:39 PM |
ohhhh failll i wrote all those for nothing D: And yes, 90 times, not 91 |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 11:40 PM |
actually it's 91
1, 100 does it 100 times, so naturally 10, 100 does it 91 times |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 07 Aug 2012 11:42 PM |
I'm pretty sure that 100 - 10 is 90 But okay. |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 11:42 PM |
| and 100 - 1 is 100 amirite |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 07 Aug 2012 11:45 PM |
...... In studio: I have this script: for i=10, 100 do print(i) wait() end output: 11-100 |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 11:51 PM |
| i don't know about you bro but i got 10-100 |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 08 Aug 2012 08:25 PM |
| bro the system is fooling us |
|
|
| Report Abuse |
|
|