ItsWayneJoin Date: 2014-06-04 Post Count: 2957 |
This script is supposed to make a light flicker but the light flickers waaaay too slow. Is there a way I can make it flicker faster?
local Light = script.Parent
Light.Brightness = 7
while true do wait(0.1) do
Light.Range = math.random(2, 12)
end
end |
|
|
no
wait(0.1) ......................... |
|
|
local Light = script.Parent
Light.Brightness = 7
while true do wait(0.01) do
Light.Range = math.random(2, 12)
end
end
Now it goes x10 faster |
|
PlungeitJoin Date: 2011-11-20 Post Count: 11733 |
wait (0.1) is quite slow
try wait (0.001) |
|
|
Yes you can, by making the
while true do wait(0.1) do
into this:
while true do wait(0.01) do
But you can't go faster than that.
It's just roblox, deal with it. |
|
|
|
|
|
|
why aren't we using wait() again?
https://www.youtube.com/watch?v=EbLo9fU_3jw&feature=youtu.be&t=152 |
|
|
|
ItsWayneJoin Date: 2014-06-04 Post Count: 2957 |
"wait(0.01)"
No, same speed... |
|
|
I was just laughing at the people saying that |
|
|
is renderstepped to good to use =p |
|
|
|
render step is every frame your screen renders. that would be visually the fastest |
|
Ikren00Join Date: 2015-05-25 Post Count: 5 |
local Light = script.Parent
Light.Brightness = 7
Powered = true
while wait() and Powered do
Light.Range = math.random(2, 12)
end
|
|
jody7777Join Date: 2009-02-22 Post Count: 1343 |
u can't use render stepped in server scripts, if I remember |
|
|
Okay, all of you are idiots (well not all but whatever most of you idiots), anyway
the shortest you can wait is ~1/30th of a second, (unless you use rennderstep but lets not use that with a new scripter)
First do this
while true do
wait(1/30)
Light.Range = math.random(2, 12)
end
|
|
DarkenusJoin Date: 2014-07-17 Post Count: 1997 |
render stepped is the fastest - smoothest - and most awesome thing ever
great in camera manipulation
never used it in changing a light - however, i think itd work
http://wiki.roblox.com/index.php?title=API:Class/RunService/RenderStepped |
|
|
in a serverscript it wont work
|
|
|
wait()
will wait the shortest amount of time possible, which if 1/30th of a second is correct, then that's the same thing that you just did.
|
|
|
can't you just use renderstep from a localscript and invoke the server to change the light
|
|
|
^
cringe cringe cringe cringe cringe
|
|