Heartbeat ( double step )
|
Description
|
This event fires every frame in which Lua is ran. The step argument tells you how much time has passed between frames. This is usually around 1/30th of a second.
|
Member of:
|
RunService
|
The following code would be put in a Script. The script can be placed in the Workspace.
local service = game:GetService('RunService')
local variable2 = 5
wait(5)
service.Heartbeat:connect(function(variable1)
if variable2 > 0 then
variable2 = variable2 - 1
print("The function returned: "..variable1)
end
end)
The function returned: 0.033333335071802
The function returned: 0.033333335071802
The function returned: 0.033333335071802
The function returned: 0.033333335071802
The function returned: 0.033333335071802