Mzh3000
|
  |
| Joined: 22 Jan 2009 |
| Total Posts: 4967 |
|
|
| 27 Nov 2011 09:56 PM |
When I tried a script and it had no output but also did nothing.
So I this much simpler script to do the same thing, but got nothing.
THis script wouldnt work right?
e = script.Parent.Reflectance
while true do e = 0.1 wait(0.1) e = 0.2 wait(0.1) e = 0.3 wait(0.1) e = 0.4 wait(0.1) e = 0.5 wait(0.1) end
But this would.
while true do script.Parent.Reflectance = 1 wait(0.1) script.Parent.Reflectance = 0.2 wait(0.1) script.Parent.Reflectance = 1 wait(0.1) script.Parent.Reflectance = 0.4 wait(0.1) script.Parent.Reflectance = 0.5 wait(0.1) end
either I have gone retarded and messed up on variables or somethings definately broken on Roblox.
The top one wont work but the bottom one will... D: |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2011 09:58 PM |
I value can not be a variable. That is why the bottom one works.
~Some things were never meant to change~ |
|
|
| Report Abuse |
|
|
Mzh3000
|
  |
| Joined: 22 Jan 2009 |
| Total Posts: 4967 |
|
|
| 27 Nov 2011 09:59 PM |
oh it can't be a variable?
That's definately new to me.. |
|
|
| Report Abuse |
|
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
|
| 27 Nov 2011 10:01 PM |
Once you declare a variable, it won't BE that property, e will become whatever reflectance was at that time. Then all you're changing is the variable. You want to do it like this :
e=script.Parent while true do e = 0.1 wait(0.1) e = 0.2 wait(0.1) e = 0.3 wait(0.1) e = 0.4 wait(0.1) e = 0.5 wait(0.1) end
Also look up for loops on the wiki. |
|
|
| Report Abuse |
|
|
Mzh3000
|
  |
| Joined: 22 Jan 2009 |
| Total Posts: 4967 |
|
|
| 27 Nov 2011 10:02 PM |
| I see.... But I want the reflectance without copypasting that ugly line. |
|
|
| Report Abuse |
|
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
|
| 27 Nov 2011 10:04 PM |
whoops, that's what I get for editing it instead of rewriting
e=script.Parent while true do e.Reflectance = 0.1 wait(0.1) e.Reflectance = 0.2 wait(0.1) e.Reflectance = 0.3 wait(0.1) e.Reflectance = 0.4 wait(0.1) e.Reflectance = 0.5 wait(0.1) end
and really, look up for loops. You could do this in 4 lines instead of 20. |
|
|
| Report Abuse |
|
|
Mzh3000
|
  |
| Joined: 22 Jan 2009 |
| Total Posts: 4967 |
|
|
| 27 Nov 2011 10:04 PM |
Got it.
e=script.Parent while true do e.Reflectance = 0.1 wait(0.1) e.Reflectance = 0.2 wait(0.1) e.Reflectance = 0.3 wait(0.1) e.Reflectance = 0.4 wait(0.1) e.Reflectance = 0.5 wait(0.1) end
yup ty for the help. |
|
|
| Report Abuse |
|
|
Mzh3000
|
  |
| Joined: 22 Jan 2009 |
| Total Posts: 4967 |
|
|
| 27 Nov 2011 10:05 PM |
o lol we posted at the same time. This was the script I was trying in the first place.
e = script.Parent.Reflectance
for i = 1,5 do wait() e = e+1 end
for i = 5,1 do wait() e = e-1 end
|
|
|
| Report Abuse |
|
|