How does Heartbeat work exactly and how would I use it? I've been trying to figure out how to use it for a while now, and it's only been working in studio. Can anyone give me a quick run through?
game:GetService("RunService").Heartbeat:connect(function()
--Script here
end)
I've been treating it as if it were just a loop. Like this:
while true do
--Script here
end
No matter what I do 'Heartbeat' just doesnt work. Only in studio.

3 comments
I didn't learn anything from this, but UpVoted
Can stepped be used in a server-script?
Both Heartbeat and Stepped can be used in a normal script. As mentioned above, only RenderStepped requires a local script for it to run.