|
| 11 Jan 2014 03:58 PM |
What does this do versus wait()?
r = game:GetService("RunService")
r.Stepped:wait()
|
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Jan 2014 04:00 PM |
It just waits until RunService Stepped is ran. So it's pretty much like doing:
x = Game:GetService("RunService").Stepped:connect(function() end) x:disconnect() |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Jan 2014 04:00 PM |
x:disconnect() in the inside of the function x = Game:GetService("RunService").Stepped:connect(function() x:disconnect() end)
|
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 04:03 PM |
| Thanks man, and what does Stepped mean exactly? :) |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 04:04 PM |
| Sorry, lol I'm not use to Roblox studio and Roblox's methods yet. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 11 Jan 2014 04:06 PM |
| Alrighty so I assume it's more accurate, and is better to be used rather than wait()? for accuracy? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 11 Jan 2014 04:08 PM |
| Not sure, I would assume so |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 04:13 PM |
It can be used as a cheap while wait() do coroutine
game:GetService("RunService").Stepped:connect(function () print("Hi") end)
This is also the same as Spawn(function () while wait() do print("Hi") end end)
You can also sync into roblox's 60 FPS stuff
local t = tick()
game:GetService("RunService").RenderStepped:connect(function () print(tick()-t) end)
|
|
|
| Report Abuse |
|
|