Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Anyway to make Heartbeat happening once?

just found a way to make something happen really fast with heartbeat:connect and hmm it loops(obviously) and i have no idea in how to make this happen once each time is called as fast as heartbeat:connect.

3 comments

2

What are you trying to accomplish?

0

if me ~= plr then

0

sorry,its a test that could be important.

1 answer

You don't need any events to run things, just make a function and call the function. For example:

local db = false
game:GetService("RunService").Heartbeat:Connect(function(step)
	if not db then
		db = true
		--do code
	end
end)

is the same as:

function code()
	--do code
end
code()

2 comments

0

i didnt get it,thats not what i m trying to do.I just want something as fast as heartbeat or make heratbeat happen once each time is called.

0

Can you explain what you want to do because what I answered is EXACTLY what you asked for, and I even included an example showing why it is stupid to run heartbeat only once.

This discussion is preserved as it was. New answers, comments, and votes are closed.