|
| 09 Nov 2012 11:02 AM |
So, I want to do
while true do game.Lighting.Brightness=(1) wait(20) -- I want to minus 0.05 from this after 20 seconds. end |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 11:02 AM |
Oops!
while true do game.Lighting.Brightness=1 wait(20) -- I want to minus 0.05 from this after 20 seconds. end |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 11:07 AM |
while true do game.Lighting.Brightness = (game.Lighting.Brightness - 0.05) wait(20) end |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 11:10 AM |
Thanks!
What about when it gets to say, 0 brightness, start from the top? |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 11:15 AM |
while (1) do
if game.Lighting.Brightness == 0 then game.Lighting.Brightness = (game.Lighting.Brightness + 0.05) else game.Lighting.Brightness = (game.Lighting.Brightness - 0.05) wait(1)
end
end |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Nov 2012 11:33 AM |
while true do If game.Lighting.Brightness == 0 then game.Lighting.Brightness = 1 end game.Lighting.Brightness = (game.Lighting.Brightness - 0.05) wait(20) end |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 11:34 AM |
L = game.Lighting function run() while L.Brightness > 0 do L.Brightness = L.Brightness - .05 end run() end run()
Maybe? |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Nov 2012 12:25 PM |
while true do if game.Lighting.Brightness == 0 then game.Lighting.Brightness = 1 end game.Lighting.Brightness = (game.Lighting.Brightness - 0.05) wait(20) end |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Nov 2012 01:17 PM |
Any output? QQ What's the current value of game.Lighting.Brightness? |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 01:18 PM |
You are waiting 20 seconds?
You do realise that the change will be miniscule? |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 02:06 PM |
| Because of Lua's double value precision , your number well never be exactly equal to zero after you subtract. Use <0.05 I stead of ==0. |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 02:38 PM |
Why not just use a for loop?
local l = game.Lighting for b = l.Brightness,0,-0.05 do l.Brightness = b Wait() end |
|
|
| Report Abuse |
|
|
1Topcop
|
  |
| Joined: 09 Jun 2009 |
| Total Posts: 6635 |
|
|
| 09 Nov 2012 02:59 PM |
crazy has an error O: He put Wait() not wait() o: |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 03:14 PM |
Sigh... Wait works just like wait. Please learn up on rbx.Lua |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 04:01 PM |
I prefer to Capitalize all function names, therefore, I will use capitalized global functions if they exist.
wait, Wait delay, Delay spawn, Spawn
Some examples that have duplicates. |
|
|
| Report Abuse |
|
|