--[=[
	Executes code at a specific point in Roblox's engine.
	@function onSteppedFrame
	@param func function
	@return RBXScriptConnection
	@within onSteppedFrame
]=]

return function(func)
	assert(type(func) == "function", "Bad func")

	local conn
	conn = RunService.Stepped:Connect(function()
		conn:Disconnect()
		func()
	end)

	return conn
end
